mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-02 15:24:11 +02:00
* Implemented overloaded variant of fileage function
git-svn-id: trunk@21867 -
This commit is contained in:
parent
597483610b
commit
789a6452c9
@ -111,4 +111,4 @@ Function FileIsReadOnly(const FileName: String): Boolean;
|
||||
|
||||
Function GetFileHandle(var f : File):THandle;
|
||||
Function GetFileHandle(var f : Text):THandle;
|
||||
|
||||
function FileAge(const FileName: string; out FileDateTime: TDateTime; FollowLink: Boolean = True): Boolean;
|
||||
|
@ -155,6 +155,25 @@
|
||||
temp.free;
|
||||
end;
|
||||
|
||||
function FileAge(const FileName: string; out FileDateTime: TDateTime; FollowLink: Boolean = True): Boolean;
|
||||
|
||||
Var
|
||||
Info : TSearchRec;
|
||||
A : Integer;
|
||||
|
||||
begin
|
||||
for A:=1 to Length(FileName) do
|
||||
If (FileName[A] in ['?','*']) then
|
||||
Exit(False);
|
||||
A:=0;
|
||||
if Not FollowLink then
|
||||
A:=A or faSymLink;
|
||||
Result:=FindFirst(FileName,A,Info)=0;
|
||||
If Result then
|
||||
FileDateTime:=FileDatetoDateTime (Info.Time);
|
||||
FindClose(Info);
|
||||
end;
|
||||
|
||||
{ Interfaces support }
|
||||
{$i sysuintf.inc}
|
||||
|
||||
@ -761,3 +780,4 @@ begin
|
||||
If Assigned(OnBeep) then
|
||||
OnBeep;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user