2
0
Эх сурвалжийг харах

implemented FileGetDate for MorphOS, based on FileAge implementation

git-svn-id: trunk@24775 -
Károly Balogh 12 жил өмнө
parent
commit
e3594452b5

+ 18 - 1
rtl/morphos/sysutils.pp

@@ -124,8 +124,25 @@ end;
 
 
 
 
 function FileGetDate(Handle: LongInt) : LongInt;
 function FileGetDate(Handle: LongInt) : LongInt;
+var
+  tmpFIB : PFileInfoBlock;
+  tmpDateTime: TDateTime;
+  validFile: boolean;
 begin
 begin
-  {$WARNING filegetdate call is dummy}
+  validFile:=false;
+
+  if (Handle <> 0) then begin
+    new(tmpFIB);
+    if ExamineFH(Handle,tmpFIB) then begin
+      tmpDateTime:=AmigaFileDateToDateTime(tmpFIB^.fib_Date,validFile);
+    end;
+    dispose(tmpFIB);
+  end;
+
+  if validFile then
+    result:=DateTimeToFileDate(tmpDateTime)
+  else
+    result:=-1;   
 end;
 end;