System.SysUtils.FileGetDate
Delphi
function FileGetDate(Handle: THandle): LongInt;
C++
extern DELPHI_PACKAGE int __fastcall FileGetDate(NativeUInt Handle);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Returns an OS time stamp for a specified file.
Use FileGetDate to determine the timestamp of a file, given its handle.
The return value is -1 if the handle is invalid.
The FileDateToDateTime function can be used to convert the returned value to a TDateTime value.
Note: FileGetDate uses a file handle rather than a native Delphi file variable. To obtain the timestamp of a file that has not been opened using the FileOpen or FileCreate method, use the FileAge function instead.
Note: On MacOS, -1 is always a valid timestamp. Use FileExists instead, to verify that the file does or does not exist.