mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-17 10:09:24 +02:00
* Checks for directory and special directories
(cherry picked from commit 32884082e3
)
This commit is contained in:
parent
d0480a622b
commit
1b1f9fe2ce
@ -630,6 +630,16 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
function TUnicodeSearchRec.IsDirectory: Boolean;
|
||||
begin
|
||||
Result:=(Attr and faDirectory)<>0;
|
||||
end;
|
||||
|
||||
function TUnicodeSearchRec.IsCurrentOrParentDir: Boolean;
|
||||
begin
|
||||
Result:=IsDirectory and ((Name='.') or (Name='..'));
|
||||
end;
|
||||
|
||||
{ TRawbyteSearchRec }
|
||||
|
||||
function TRawbyteSearchRec.GetTimeStamp: TDateTime;
|
||||
@ -641,6 +651,16 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
function TRawbyteSearchRec.IsDirectory: Boolean;
|
||||
begin
|
||||
Result:=(Attr and faDirectory)<>0;
|
||||
end;
|
||||
|
||||
function TRawbyteSearchRec.IsCurrentOrParentDir: Boolean;
|
||||
begin
|
||||
Result:=IsDirectory and ((Name='.') or (Name='..'));
|
||||
end;
|
||||
|
||||
{ TUnicodeSymLinkRec }
|
||||
|
||||
function TUnicodeSymLinkRec.GetTimeStamp: TDateTime;
|
||||
|
@ -45,6 +45,9 @@ Type
|
||||
{$endif}
|
||||
|
||||
// The actual unicode search record
|
||||
|
||||
{ TUnicodeSearchRec }
|
||||
|
||||
TUnicodeSearchRec = Record
|
||||
Time : Longint;
|
||||
Size : Int64;
|
||||
@ -61,9 +64,13 @@ Type
|
||||
private
|
||||
function GetTimeStamp: TDateTime;
|
||||
public
|
||||
Function IsDirectory : Boolean; inline;
|
||||
function IsCurrentOrParentDir: Boolean; inline;
|
||||
property TimeStamp: TDateTime read GetTimeStamp;
|
||||
end;
|
||||
|
||||
{ TRawbyteSearchRec }
|
||||
|
||||
TRawbyteSearchRec = Record
|
||||
Time : Longint;
|
||||
Size : Int64;
|
||||
@ -80,6 +87,8 @@ Type
|
||||
private
|
||||
function GetTimeStamp: TDateTime;
|
||||
public
|
||||
Function IsDirectory : Boolean; inline;
|
||||
function IsCurrentOrParentDir: Boolean; inline;
|
||||
property TimeStamp: TDateTime read GetTimeStamp;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user