Selaa lähdekoodia

implemented FileGetDate for MorphOS, based on FileAge implementation

git-svn-id: trunk@24775 -
Károly Balogh 12 vuotta sitten
vanhempi
commit
e3594452b5
1 muutettua tiedostoa jossa 18 lisäystä ja 1 poistoa
  1. 18 1
      rtl/morphos/sysutils.pp

+ 18 - 1
rtl/morphos/sysutils.pp

@@ -124,8 +124,25 @@ end;
 
 
 function FileGetDate(Handle: LongInt) : LongInt;
+var
+  tmpFIB : PFileInfoBlock;
+  tmpDateTime: TDateTime;
+  validFile: boolean;
 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;