浏览代码

* check if fileAge returns -1

pierre 22 年之前
父节点
当前提交
6365e9bfa8
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      tests/webtbs/tw0719.pp

+ 6 - 2
tests/webtbs/tw0719.pp

@@ -9,8 +9,12 @@ begin
 r:=FindFirst('*.*',faAnyFile,SR);
 while r=0 do
   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);
   end;
 FindClose(SR);