RAD Studio
ContentsIndex
PreviousUpNext
File Date-time Routines

The FileAge, FileGetDate, and FileSetDate routines operate on operating system date-time values. FileAge returns the date-and-time stamp of a file, or -1 if the file does not exist. FileSetDate sets the date-and-time stamp for a specified file, and returns zero on success or an error code on failure. FileGetDate returns a date-and-time stamp for the specified file or –1 if the handle is invalid. 

As with most of the file manipulating routines, FileAge uses a string filename. FileGetDate and FileSetDate, however, use a Handle type as a parameter. To get the file handle either:

  • Use the FileOpen or FileCreate function to create a new file or open an existing file. Both FileOpen and FileCreate return the file handle.
  • Instantiate TFileStream to create or open a file. Then use its Handle property. See Using file streams for more information.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!