From 725e6e3c8e52ede0edec0fa15da3f148bb2f7d74 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Wed, 9 May 2018 00:01:58 +0200 Subject: 9.4 --- zen/file_access.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'zen/file_access.cpp') diff --git a/zen/file_access.cpp b/zen/file_access.cpp index 69b6c388..e7467325 100755 --- a/zen/file_access.cpp +++ b/zen/file_access.cpp @@ -14,8 +14,8 @@ #include "symlink_target.h" #include "file_id_def.h" #include "file_io.h" -#include "crc.h" -#include "guid.h" +#include "crc.h" //boost dependency! +#include "guid.h" // #include //statfs #include //lutimes @@ -627,10 +627,13 @@ FileCopyResult copyFileOsSpecific(const Zstring& sourceFile, //throw FileError, //=> don't delete file that existed previously!!! FileOutput fileOut(fdTarget, targetFile, IOCallbackDivider(notifyUnbufferedIO, totalUnbufferedIO)); //pass ownership - bufferedStreamCopy(fileIn, fileOut); //throw FileError, X + //fileOut.preAllocateSpaceBestEffort(sourceInfo.st_size); //throw FileError + //=> perf: seems like no real benefit... + + bufferedStreamCopy(fileIn, fileOut); //throw FileError, (ErrorFileLocked), X //flush intermediate buffers before fiddling with the raw file handle - fileOut.flushBuffers(); //throw FileError, X + fileOut.flushBuffers(); //throw FileError, X struct ::stat targetInfo = {}; if (::fstat(fileOut.getHandle(), &targetInfo) != 0) -- cgit