Browse Source

* check if fileAge returns -1

pierre 22 years ago
parent
commit
6365e9bfa8
1 changed files with 6 additions and 2 deletions
  1. 6 2
      tests/webtbs/tw0719.pp

+ 6 - 2
tests/webtbs/tw0719.pp

@@ -9,8 +9,12 @@ begin
 r:=FindFirst('*.*',faAnyFile,SR);
 r:=FindFirst('*.*',faAnyFile,SR);
 while r=0 do
 while r=0 do
   begin
   begin
-    S:=DateTimeToStr(FileDateToDateTime(FileAge(SR.Name)));
-    Writeln(SR.Name,' has Date ',S);
+    r:=FileAge(SR.Name);
+    if r<>-1 then
+      begin
+        S:=DateTimeToStr(FileDateToDateTime(r));
+        Writeln(SR.Name,' has Date ',S);
+      end;
     r:=FindNext(SR);
     r:=FindNext(SR);
   end;
   end;
 FindClose(SR);
 FindClose(SR);