Forum > General

How read the creation date of a file

(1/1)

xinyiman:
Hello guys, I need to know the creation date of a file? Does anyone know how?  :) :)

Peter_Vadasz:
In the BaseUnix unit there is an FpStat procedure. You can see it on the following link:
http://www.freepascal.org/docs-html/rtl/baseunix/fpstat.html
It works under Linux, but I don't know if it works under Windows.

ps. Sorry for my english

clauslack:
Check this too

http://www.lazarus.freepascal.org/index.php/topic,6705.0.html

Regards

marcov:
Under Delphi, I use this (windows). Will work under FPC too probably.


--- Code: ---function getcreationtime(fn:string;var v: TDateTime):Boolean;
var fl:TSearchRec;
begin
  result:=GetFileInformation(fn,fl);
  if result then
    v:=filetimetodatetime(fl.FindData.ftCreationTime);
end;

--- End code ---

Navigation

[0] Message Index

Go to full version