File Date-time Routines

From RAD Studio
Jump to: navigation, search

Go Up to Manipulating Files

The following 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 FileCreate or FileOpen 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.

See Also