mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: IsHidden function
This commit is contained in:
parent
5d8b50ad82
commit
23e7bc5f2d
1 changed files with 15 additions and 0 deletions
|
|
@ -188,6 +188,7 @@ type
|
|||
// These functions should probably be moved from here and should not be methods.
|
||||
function IsDirectory: Boolean;
|
||||
function IsSysFile: Boolean;
|
||||
function IsHidden: Boolean;
|
||||
function IsLink: Boolean;
|
||||
property IsLinkToDirectory: Boolean read GetIsLinkToDirectory write SetIsLinkToDirectory;
|
||||
function IsExecutable: Boolean; // for ShellExecute
|
||||
|
|
@ -807,6 +808,20 @@ begin
|
|||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function TFile.IsHidden: Boolean;
|
||||
begin
|
||||
if not (fpAttributes in SupportedProperties) then
|
||||
Result := False
|
||||
else begin
|
||||
if Properties[fpAttributes] is TNtfsFileAttributesProperty then
|
||||
Result := TNtfsFileAttributesProperty(Properties[fpAttributes]).IsHidden
|
||||
else begin
|
||||
// Files beginning with '.' are treated as system/hidden files on Unix.
|
||||
Result := (Length(Name) > 1) and (Name[1] = '.') and (Name <> '..');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFile.SplitIntoNameAndExtension(const FileName: string;
|
||||
var aFileNameOnly: string;
|
||||
var aExtension: string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue