Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
SetFTime Procedure
◄Summary► ◄Details► ◄Example► ◄Back►
Arguments
file_variable Typed, untyped, or text file; already open
time Date and time in packed 4-byte format
Description
The SetFTime procedure changes the date and time of the last
modification of a file. SetFTime permanently changes the DOS
directory entry that keeps this information.
The file_variable argument must be associated with an opened file
of any type. Use the Assign procedure to associate a file name with
file_variable. Open a file with the Append, Reset, or Rewrite
procedures.
The time argument passes a date and time in packed 4-byte format.
Use the PackTime procedure to pack the time setting from a DateTime
record. The Dos unit defines the DateTime record type.
DOS updates the date and time of a file when a file is closed. If
a file has been written to before the call to SetFTime, DOS erases
the change made by SetFTime when the file is closed. To make the
change permanent after a file is closed, follow the SetFTime call
with a call to Reset and then Close, without performing any further
operations on the file.
SetFTime reports error conditions in DosError, defined in the Dos
unit. If no error occurs, SetFTime sets DosError to 0. The only
possible error value is 6, meaning "invalid file handle."