PhysiologyWeb Logo  Search
Share on Facebook Share on Twitter Share on LinkedIn Share on Pinterest Email Copy URL
PhysiologyWeb Loading...

Set File Last Access Date and Time
Here is a simple Delphi procedure that takes a file name and a date/time as its two input parameters, and sets the date and time the file was last accessed (i.e., last access date/time stamp) to the input date/time. For additional Delphi code for the Windows operating system, see Useful Delphi Code for the Windows Operating System.
procedure SetFileLastAccessDateTime(FileName: String; DateTime: TDateTime);
begin
If (FileName <> '') and (FileExists(FileName) = True) then
begin
TFile.SetLastAccessTime(FileName, DateTime);
//TFile record is found in the IOUtils unit
end;
end;






Posted: Saturday, May 20, 2023