Change DOS Files Date Time Stamp in delphi

Change DOS Files Date Time Stamp in delphi

// Change DOS Files Date Time Stamp

procedure TForm1.Button1Click(Sender: TObject);
var
OutFile: file;
OutFileName: string;
FileDateTime: TDateTime;
begin
//File which date & time stamp are to change…
OutFileName := ‘c:\Test.txt’;
AssignFile(OutFile, OutFileName);
Reset(OutFile);
//Get file’s current date & time stamp…
FileDateTime := FileDateToDateTime(FileAge(OutFileName));
//Set file’s date one day ahead!
FileSetDate(TFileRec(OutFile).Handle, DateTimeToFileDate(FileDateTime + 1));
end;