Browse Source

* FileNewer should return true if the dest file does not exist.

Michaël Van Canneyt 1 year ago
parent
commit
f73456a9d9
1 changed files with 7 additions and 0 deletions
  1. 7 0
      packages/fpmkunit/src/fpmkunit.pp

+ 7 - 0
packages/fpmkunit/src/fpmkunit.pp

@@ -7415,6 +7415,13 @@ begin
       exit;
       exit;
     end;
     end;
   DD:=FileAge(Dest);
   DD:=FileAge(Dest);
+  { Return true if dest file not found or not accessible }
+  if DD=-1 then
+    begin
+      Result:=True;
+      exit;
+    end;
+
   D1:=FileDateToDateTime(DS);
   D1:=FileDateToDateTime(DS);
   D2:=FileDateToDateTime(DD);
   D2:=FileDateToDateTime(DD);
   Log(vlDebug,SDbgComparingFileTimes,[Src,DateTimeToStr(D1),Dest,DateTimeToStr(D2)]);
   Log(vlDebug,SDbgComparingFileTimes,[Src,DateTimeToStr(D1),Dest,DateTimeToStr(D2)]);