0

I'm attempting to find the last modified time of a folder in Delphi 7.

I'm attempting to do:

var
  FoundDir: TSearchRec;
  LastRunTime: Integer; //This is a unix timestamp of the last time I scanned this directory.
begin
  FindFirst(Directory, faDirectory, FoundDir);
  if FoundDir.FindData.ftLastWriteTime > LastRunTime
    then //do stuff.
end;

But ftLastWriteTime is a _FILETIME object (a C based object returned from WinAPI). My question is, how do I convert either LastRunTime into a comperable _FILETIME object, or vice versa.

I've tried looking at the .time attribute of FoundDir, but that only shows the created time.

I guess this is really two questions:

  1. How do I build an int from dwLowDateTime and dwHighDateTime.
  2. How do I convert it to a UNIX timestamp (Answer to that is provided by the duplicate question link)
Morgan Thrapp
  • 9,146
  • 3
  • 45
  • 61

0 Answers0