* initial fileflush, mantis #15824

git-svn-id: trunk@37135 -
This commit is contained in:
marco 2017-09-03 16:41:32 +00:00
parent bb31bc6ca4
commit b6824290fc
5 changed files with 23 additions and 1 deletions

View File

@ -557,3 +557,9 @@ begin
end;
{$ifndef SYSUTILS_HAS_FILEFLUSH_IMPL}
function FileFlush(Handle: THandle): Boolean;
begin
Result:= False;
end;
{$endif}

View File

@ -176,6 +176,7 @@ Function FileRead (Handle : THandle; out Buffer; Count : longint) : Longint;
Function FileWrite (Handle : THandle; const Buffer; Count : Longint) : Longint;
Function FileSeek (Handle : THandle; FOffset, Origin: Longint) : Longint;
Function FileSeek (Handle : THandle; FOffset: Int64; Origin: Longint) : Int64;
function FileFlush(Handle: THandle): Boolean;
Procedure FileClose (Handle : THandle);
Function FileTruncate (Handle : THandle;Size: Int64) : boolean;
Function FindNext (Var Rslt : TRawByteSearchRec) : Longint;

View File

@ -38,6 +38,9 @@ interface
{$DEFINE HAS_LOCALTIMEZONEOFFSET}
{$DEFINE HAS_GETTICKCOUNT64}
// this target has an fileflush implementation, don't include dummy
{$DEFINE SYSUTILS_HAS_FILEFLUSH_IMPL}
{ used OS file system APIs use ansistring }
{$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}
{ OS has an ansistring/single byte environment variable API }
@ -484,6 +487,10 @@ begin
FileOpen:=DoFileLocking(FileOpen, Mode);
end;
function FileFlush(Handle: THandle): Boolean;
begin
Result:= fpfsync(handle)=0;
end;
Function FileCreate (Const FileName : RawByteString) : Longint;

View File

@ -37,6 +37,9 @@ uses
{$DEFINE HAS_GETTICKCOUNT64}
{$DEFINE OS_FILESETDATEBYNAME}
// this target has an fileflush implementation, don't include dummy
{$DEFINE SYSUTILS_HAS_FILEFLUSH_IMPL}
{ used OS file system APIs use unicodestring }
{$define SYSUTILS_HAS_UNICODESTR_FILEUTIL_IMPL}
{ OS has an ansistring/single byte environment variable API }
@ -283,6 +286,11 @@ const
FILE_SHARE_READ or FILE_SHARE_WRITE);
function FileFlush(Handle: THandle): Boolean;
begin
Result:= FlushFileBuffers(Handle);
end;
Function FileOpen (Const FileName : unicodestring; Mode : Integer) : THandle;
begin
result := CreateFileW(PWideChar(FileName), dword(AccessMode[Mode and 3]),

View File

@ -1 +1 @@
'2017-08-12 rev 36877'
'2017-08-22 rev 37024'