From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function FileSetDate(const FileName: string; Age: LongInt): Integer;
function FileSetDate(Handle: THandle; Age: Integer): Integer;


extern DELPHI_PACKAGE int __fastcall FileSetDate(const System::UnicodeString FileName, int Age)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Sets the OS time stamp for a specified file.

FileSetDate sets the OS time stamp of the specified file to the value given by Age. The DateTimeToFileDate function can be used to convert a TDateTime value to an OS time stamp.

FileName is the name of the file to alter.

Age is the time stamp to apply to the specified file.

Note: Handle is the Windows file handle of the file to alter. This syntax is only available on Windows.

The return value is zero if the function was successful. Otherwise, the return value is an error code.

Note: If the FileName parameter is a symbolic link, the method is performed on the target file.

See Also

Code Examples