[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

FileAgeUTF8

Returns the last modification time for the file in FileDate format

Declaration

Source position: lazfileutils.pas line 107

function FileAgeUTF8(

  const FileName: string

):LongInt;

Arguments

FileName

  

File name for the function

Function result

Last modification time for the file in FileDate format

Description

FileAgeUTF8 is a Longint function which returns the last modification time for the file in FileName. FileAgeUTF8 cannot be used on directories, and returns -1 if FileName indicates a directory.

For UNIX-like environments, the return value is provided by the FileAge function in SysUtils. For the Windows environment, FindFirstFileW is used to get TWin32TWin32FindDataW data for the specified file. Its ftLastWriteTime value is converted using WinToDosTime to get the return value for the function.

The return value is in FIleDate format, and can be transformed to TDateTime format with the FileDateToDateTime function.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.