Don't automatically mark copied files as writable on Windows (non-Unicode and CE)

This commit is contained in:
Scott Davis
2015-01-16 15:09:00 -05:00
parent fc24be6199
commit 9913ee1ac8
2 changed files with 29 additions and 37 deletions

View File

@@ -288,12 +288,8 @@ void FileImpl::copyToImpl(const std::string& path) const
{ {
poco_assert (!_path.empty()); poco_assert (!_path.empty());
if (CopyFileA(_path.c_str(), path.c_str(), FALSE) != 0) if (CopyFileA(_path.c_str(), path.c_str(), FALSE) == 0)
{ handleLastErrorImpl(_path);
FileImpl copy(path);
copy.setWriteableImpl(true);
}
else handleLastErrorImpl(_path);
} }

View File

@@ -285,12 +285,8 @@ void FileImpl::copyToImpl(const std::string& path) const
std::wstring upath; std::wstring upath;
UnicodeConverter::toUTF16(path, upath); UnicodeConverter::toUTF16(path, upath);
if (CopyFileW(_upath.c_str(), upath.c_str(), FALSE) != 0) if (CopyFileW(_upath.c_str(), upath.c_str(), FALSE) == 0)
{ handleLastErrorImpl(_path);
FileImpl copy(path);
copy.setWriteableImpl(true);
}
else handleLastErrorImpl(_path);
} }