-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheBackupSystemHelpers.pas
More file actions
executable file
·39 lines (30 loc) · 969 Bytes
/
eBackupSystemHelpers.pas
File metadata and controls
executable file
·39 lines (30 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
unit eBackupSystemHelpers;
interface
uses Windows;
function GetFolderDate(const iFolder:string):TDateTime;
function FileTimeToDateTime(const iTime:TFileTime):TDateTime;
implementation
uses SysUtils;
function GetFolderDate(const iFolder:string):TDateTime;
var lSearch:TSearchRec;
lOk:dword;
lDate:TFileTime;
begin
lOk := FindFirst(iFolder+'\*.*',$3f,lSearch);
try
if lOk <> 0 then
raise Exception.CreateFmt('Folder "%s" nor found',[iFolder]);
result := FileTimeToDateTime(lSearch.FindData.ftLastWriteTime);
finally
FindClose(lSearch);
end;
end;
function FileTimeToDateTime(const iTime:TFileTime):TDateTime;
var lLocalFileTime: TFileTime;
lFileDate:integer;
begin
FileTimeToLocalFileTime(iTime, lLocalFileTime);
if not FileTimeToDosDateTime(lLocalFileTime, LongRec(lFileDate).Hi, LongRec(lFileDate).Lo) then RaiseLastOsError();
result := FileDateToDateTime(lFileDate);
end;
end.