Author: Jonas Bilinkevicius
How to set the date stamp of a file equal to the date stamp of another
Answer:
Just use the following function, which takes two strings representing full DOS
path/ file names. The file who's date you wish to set is the second parameter, and
the date you wish to set it to is given by the file in the first parameter.
1 procedure CopyFileDate(const Source, Dest: string);
2 var3 SourceHand, DestHand: word;
4 begin5 SourceHand := FileOpen(Source, fmOutput); { open source file }6 DestHand := FileOpen(Dest, fmInput); { open dest file }7 FileSetDate(DestHand, FileGetDate(SourceHand)); { get / set date }8 FileClose(SourceHand); { close source file }9 FileClose(DestHand); { close dest file }10 end;