mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Merge pull request #143 from actboy168/patch-1
Fixes skip_existing on fs::copy
This commit is contained in:
commit
de64decd91
@ -3920,11 +3920,14 @@ GHC_INLINE bool copy_file(const path& from, const path& to, copy_options options
|
||||
ec = tecf;
|
||||
return false;
|
||||
}
|
||||
if (exists(st) && (!is_regular_file(st) || equivalent(from, to, ec) || (options & (copy_options::skip_existing | copy_options::overwrite_existing | copy_options::update_existing)) == copy_options::none)) {
|
||||
ec = tect ? tect : detail::make_error_code(detail::portable_error::exists);
|
||||
return false;
|
||||
}
|
||||
if (exists(st)) {
|
||||
if ((options & copy_options::skip_existing) == copy_options::skip_existing) {
|
||||
return false;
|
||||
}
|
||||
if (!is_regular_file(st) || equivalent(from, to, ec) || (options & (copy_options::overwrite_existing | copy_options::update_existing)) == copy_options::none) {
|
||||
ec = tect ? tect : detail::make_error_code(detail::portable_error::exists);
|
||||
return false;
|
||||
}
|
||||
if ((options & copy_options::update_existing) == copy_options::update_existing) {
|
||||
auto from_time = last_write_time(from, ec);
|
||||
if (ec) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user