Browse Source

* Add Flush method to TFileStream. Fix issue #39619

Michaël Van Canneyt 3 years ago
parent
commit
5ca52bcab1
2 changed files with 6 additions and 0 deletions
  1. 1 0
      rtl/objpas/classes/classesh.inc
  2. 5 0
      rtl/objpas/classes/streams.inc

+ 1 - 0
rtl/objpas/classes/classesh.inc

@@ -1187,6 +1187,7 @@ type
     constructor Create(const AFileName: string; Mode: Word);
     constructor Create(const AFileName: string; Mode: Word; Rights: Cardinal);
     destructor Destroy; override;
+    Function Flush : Boolean;
     property FileName : String Read FFilename;
   end;
 

+ 5 - 0
rtl/objpas/classes/streams.inc

@@ -1336,6 +1336,11 @@ begin
   FileClose(FHandle);
 end;
 
+function TFileStream.Flush : Boolean;
+begin
+  Result:=FileFlush(Handle);
+end;
+
 {****************************************************************************}
 {*                             TCustomMemoryStream                          *}
 {****************************************************************************}