delphi - FileAge is not working with "c:\pagefile.sys" -
does know why fileage not working "c:\pagefile.sys"? returns -1.
update:
found it: delphi bug fixed in delphi 2010 (qc entry 73539), the pdf have found not explain how fix it.
does know how fix can fix delphi 7?
update: elegant fix provided radu barbu!
delphi 7, win 7 (32 bits)
try this:
with variable of type tsearchrec (wsr bellow) load pagefile.sys
wsr.finddata.ftlastwritetime
- should return when file accessed
and function bellow should time
function filetime2datetime(filetime: tfiletime): tdatetime; var localfiletime : tfiletime; systemtime : tsystemtime; begin result := 0; try filetimetolocalfiletime(filetime, localfiletime); filetimetosystemtime(localfiletime, systemtime); result := systemtimetodatetime(systemtime); except on e: exception //some message if want end; end;
best regards,
Comments
Post a Comment