File creation time - linux lazarus / 13-General ---------------------------------------------------------------------- Elphi · 2009-05-09 20:20 How can I get a file creation time on linux? On windows I use the following: Code: [Select]function FileGetCreationTime(const AFileName: AnsiString): TDateTime; var   SearchRec: TSearchRec;   SysTime: SYSTEMTIME;   FileTime: TFILETIME; begin   if FindFirst(AFileName, faAnyFile, SearchRec) = 0 then   begin     FileTimeToLocalFileTime(SearchRec.FindData.ftCreationTime, FileTime);     FileTimeToSystemTime(FileTime, SysTime);     Result := SystemTimeToDateTime(SysTime);   end; end; ---------------------------------------------------------------------- kandukeswara · 2009-12-16 03:02 maybe you can change : FileTimeToLocalFileTime(SearchRec.FindData.ftCreationTime, FileTime); on line 9, to : FileTimeToLocalFileTime(SearchRec.Time, FileTime); good luck ---------------------------------------------------------------------- clauslack · 2009-12-16 03:21 I think that work fine in Linux and Windows. Code: [Select]var fecha:Tdate;fechatmp:longint;filename:string; fechatmp:=FileAge(filename); fecha:=int(FileDateToDateTime(fechatmp)) check filename if is ANSI or UTF8..(FileAge(utf8tosys(filename))) Regards ---------------------------------------------------------------------- Hitman · 2009-12-16 12:24 There is no such thing as "File creation time" on *nix file systems. http://www.cyberciti.biz/tips/understanding-unixlinux-filesystem- inodes.html