mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Merge branch 'master' of github.com:gulrak/filesystem
This commit is contained in:
commit
962df76d10
@ -3118,7 +3118,7 @@ GHC_INLINE bool copy_file(const path& from, const path& to, copy_options options
|
|||||||
ec = std::error_code(errno, std::system_category());
|
ec = std::error_code(errno, std::system_category());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::shared_ptr<void> guard_out(nullptr, [out](void*) { ::close(out); });
|
std::shared_ptr<void> guard_in(nullptr, [in](void*) { ::close(in); });
|
||||||
int mode = O_CREAT | O_WRONLY | O_TRUNC;
|
int mode = O_CREAT | O_WRONLY | O_TRUNC;
|
||||||
if (!overwrite) {
|
if (!overwrite) {
|
||||||
mode |= O_EXCL;
|
mode |= O_EXCL;
|
||||||
@ -3127,7 +3127,7 @@ GHC_INLINE bool copy_file(const path& from, const path& to, copy_options options
|
|||||||
ec = std::error_code(errno, std::system_category());
|
ec = std::error_code(errno, std::system_category());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::shared_ptr<void> guard_in(nullptr, [in](void*) { ::close(in); });
|
std::shared_ptr<void> guard_out(nullptr, [out](void*) { ::close(out); });
|
||||||
ssize_t br, bw;
|
ssize_t br, bw;
|
||||||
while ((br = ::read(in, buffer.data(), buffer.size())) > 0) {
|
while ((br = ::read(in, buffer.data(), buffer.size())) > 0) {
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user