Delphi: file attributes: read creation and last access dates


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]

Posted by *DClub* Stefan Loeners on September 07, 2003 at 22:57:50:

How would I retrieve the CREATION date and the LAST ACCESS date of a given file?
The function below reads the third date attribute, the date a file was LAST MODIFIED:

function GetFileDateTime(FileName: string): TDateTime;
var 
  intFileAge: LongInt;
begin
  intFileAge := FileAge(FileName);
  if intFileAge = -1 then
    Result := 0
  else
    Result := FileDateToDateTime(intFileAge)
end; 

Thank you.


Related Articles and Replies:


[ Delphi Forum ]
[ DelphiLand: free Delphi source code, tips, tutorials ]