获取文件最后写入时间
程序员文章站
2022-05-24 12:30:12
...
subtype FILETIME is QWord;
type WIN32_FIND_DATAA is record
FileAttributes : DWORD;
CreationTime : FILETIME;
LastAccessTime : FILETIME;
LastWriteTime : FILETIME;
FileSize : QWORD:=0;
Reserved : QWORD;
FileName : String (1 .. 260);
AlternateFileName : String (1 .. 14);
end record with Pack;
function FindFirstFile(Path:String;pf:access WIN32_FIND_DATAA) return int with Import,Convention=>Stdcall,external_Name=>"FindFirstFileA";
function GetFileLastWriteTime(fn:String) return QWORD is
FD:aliased WIN32_FIND_DATAA;
fnc:constant String:=fn&Nul;
hf:int:=FindFirstFile(fnc,FD'Access);
begin
if hf /= 0 then
return FD.LastWriteTime;
end if;
return 0;
end GetFileLastWriteTime;
上一篇: Bonecp、Druid、C3P0、DBCP连接池xml配置
下一篇: MFC 关于系统时间获取