Return the timestamp of a file.
Source position: filutilh.inc line 222
function FileAge( |
const FileName: UnicodeString |
):Int64; |
const FileName: UnicodeString; |
out FileDateTime: TDateTime; |
FollowLink: Boolean = True |
):Boolean; |
const FileName: RawByteString; |
out FileDateTime: TDateTime; |
FollowLink: Boolean = True |
):Boolean; |
const FileName: RawByteString |
):Int64; |
FileAge in it's simplest form returns the last modification time of file FileName as an opaque os-dependent file timestamp. In this case, the return value can be transformed to a TDateTime value with the FileDateToDateTime function.
In case a FileDateTime argument is supplied, the FileAge function will do the transformation by itself, and the file time will be returned in the FileDateTime argument as a TDateTime value. The function return value is then a boolean indicating success or failure.
The FollowSymlink parameter can be set to False to read the timestamp of a symbolic link, instead of the timestamp of the file the symbolic link points to (which is the default behaviour).
FileAge cannot be used on directories, it will return -1 (or False) if FileName indicates a directory.
In case of errors, -1 or False is returned.
|
Convert a FileDate value to a TDateTime value. |
|
|
Check whether a particular file exists in the file system. |
|
|
Return attributes of a file. |
Program Example36; { This program demonstrates the FileAge function } Uses sysutils; Var S : TDateTime; fa : Longint; Begin fa:=FileAge('ex36.pp'); If Fa<>-1 then begin S:=FileDateTodateTime(fa); Writeln ('I''m from ',DateTimeToStr(S)) end; End.