Sign in Join
FPDoc Onlineexperiment

FileAgeCached function

In unit LazFileCache

Gets the file age for the specified file or directory.

Declaration

pascal
function FileAgeCached(const AFileName: string): Int64

Description

FileAgeCached is an Int64 function used to get file age for the file specified file name. The return is derived from one of three mechanisms:

  • The OnFileAgeCached event handler for the unit (when assigned). This allows the routine to be used for symbolic directory names (like '.' or '..') or virtual file names in the IDE.
  • The FileStateCache maintained in the unit (when assigned).
  • Or, the UniversalFileAgeUTF8 routine from the LazFileUtils.pas unit in the LazUtils package. This routine returns the value from the SysUtils.FileAge routine in the RTL. This the default mechanism used if the other two are not assigned.

This routine is used primarily in the Lazarus IDE and its build manager.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.