Browse Source

Correct logic in TFile.Open

Oleg Latov 1 month ago
parent
commit
df854535da
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/vcl-compat/src/system.ioutils.pp

+ 1 - 1
packages/vcl-compat/src/system.ioutils.pp

@@ -1966,7 +1966,7 @@ begin
     Result:=TFileStream.Create(aPath, {$IFDEF FPC_DOTTEDUNITS}System.{$ENDIF}Classes.fmCreate or sMode);
   TFileMode.fmOpen:
     begin
-    if Exists(aPath) then
+    if not Exists(aPath) then
       Raise EInOutError.CreateFmt(SErrFileNotFound,[aPath]);
     Result:=TFileStream.Create(aPath,fMode);
     end;