summaryrefslogtreecommitdiff
path: root/zen/file_io.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
commitfe9eb89ebc1b3c33cbac00a3fa095a14faef9113 (patch)
tree8a3bb620a9acb83fe0057061a86e8f2cb91a9fe1 /zen/file_io.cpp
parent5.21 (diff)
downloadFreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.gz
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.bz2
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.zip
5.22
Diffstat (limited to 'zen/file_io.cpp')
-rw-r--r--zen/file_io.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/zen/file_io.cpp b/zen/file_io.cpp
index 45cbd028..fbca9089 100644
--- a/zen/file_io.cpp
+++ b/zen/file_io.cpp
@@ -177,7 +177,7 @@ size_t FileInput::read(void* buffer, size_t bytesToRead) //returns actual number
if (bytesRead < bytesToRead)
if (!eof()) //pathologic!?
- throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(getFilename())), L"Incomplete read!"); //user should never see this
+ throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(getFilename())), L"Incomplete read."); //user should never see this
#endif
if (bytesRead > bytesToRead)
@@ -305,7 +305,7 @@ void FileOutput::write(const void* buffer, size_t bytesToWrite) //throw FileErro
throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(getFilename())), formatSystemError(functionName, getLastError()));
if (bytesWritten != bytesToWrite) //must be fulfilled for synchronous writes!
- throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(getFilename())), L"Incomplete write!"); //user should never see this
+ throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(getFilename())), L"Incomplete write."); //user should never see this
}
@@ -318,12 +318,7 @@ FileInputUnbuffered::FileInputUnbuffered(const Zstring& filename) : FileInputBas
fdFile = ::open(filename.c_str(), O_RDONLY);
if (fdFile == -1) //don't check "< 0" -> docu seems to allow "-2" to be a valid file handle
- {
- const ErrorCode lastError = getLastError(); //copy before making other system calls!
- const std::wstring errorMsg = replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filename));
- const std::wstring errorDescr = formatSystemError(L"open", lastError);
- throw FileError(errorMsg, errorDescr);
- }
+ throw FileError(replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filename)), formatSystemError(L"open", getLastError()));
}
bgstack15