summaryrefslogtreecommitdiff
path: root/zen/file_access.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2018-05-09 00:01:58 +0200
committerDaniel Wilhelm <shieldwed@outlook.com>2018-05-09 00:01:58 +0200
commit725e6e3c8e52ede0edec0fa15da3f148bb2f7d74 (patch)
tree739061fe661dc0bd1d200b0378365f3f47ff78be /zen/file_access.cpp
parent9.3 (diff)
downloadFreeFileSync-725e6e3c8e52ede0edec0fa15da3f148bb2f7d74.tar.gz
FreeFileSync-725e6e3c8e52ede0edec0fa15da3f148bb2f7d74.tar.bz2
FreeFileSync-725e6e3c8e52ede0edec0fa15da3f148bb2f7d74.zip
9.4
Diffstat (limited to 'zen/file_access.cpp')
-rwxr-xr-xzen/file_access.cpp11
1 files changed, 7 insertions, 4 deletions
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 <sys/vfs.h> //statfs
#include <sys/time.h> //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)
bgstack15