Browse Source

* Implement TFile.OpenText

Michaël Van Canneyt 1 year ago
parent
commit
b7b665d273
1 changed files with 12 additions and 1 deletions
  1. 12 1
      packages/vcl-compat/src/system.ioutils.pp

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

@@ -1963,8 +1963,19 @@ begin
 end;
 
 class function TFile.OpenText(const aPath: string): TStreamReader;
-begin
 
+var
+  F : TFileStream;
+  
+begin
+  Result:=Nil;
+  F:=TFilestream.Create(aPath,fmOpenRead or fmShareDenyWrite);
+  try  
+    Result := TStreamReader.Create(F,BUFFER_SIZE,True);
+  except
+    F.Free;
+    Raise;
+  end
 end;
 
 class function TFile.OpenWrite(const aPath: string): TFileStream;