Previous: 4.24.2.29. SetFAttr To the Table of Contents Next: 4.24.2.31. SetIntVec
4.24.2.29. SetFAttr Table of Contents 4.24.2.31. SetIntVec

- 4.24.2.30. -
Table of Contents
4. Standard Units
4.24. DOS - MSDOS support unit
4.24.2. DOS Unit Procedures and Functions
4.24.2.30. SetFTime


4.24.2.30. SetFTime

Targets: MS-DOS, OS/2, Win32


Dos Unit, WinDos Unit

Sets the date and time a file was last written.

Declaration:
procedure SetFTime(var F; Time: Longint);
The file associated with F must be open. A packed date and time stamp can be created with PackTime. Errors are reported in DosError, a variable defined in the Dos unit. For more information about a file's packed date and time stamp consult your DOS reference manual.

Win32 target:
The file handle must have been created with GENERIC_WRITE access.

Example:
uses
  Dos;
var
  Fi  : Text;
  DT  : DateTime;
  Time: Longint;

begin
  Assign(Fi, 'FUTURE.DOC');
  Reset(Fi);
  with DT do begin
    Year  := 2010;
    Month := 3;
    Day   := 31;
    Hour  := 2;
    Min   := 45;
    Sec   := 22;
  end;
  PackTime(DT, Time);
  SetFTime(Fi, Time);
  Close(Fi);
end.



Previous: 4.24.2.29. SetFAttr To the Table of Contents Next: 4.24.2.31. SetIntVec
4.24.2.29. SetFAttr Table of Contents 4.24.2.31. SetIntVec

- 4.24.2.30. -