From fc243122b9ece2f5f35ac637ed0465c5bfcc3821 Mon Sep 17 00:00:00 2001
From: Andrey Semashev Precondition: Header
<boost/filesystem.hpp&g
update_existing,
synchronize_data,
synchronize,
+ ignore_attribute_errors,
// copy options
recursive,
copy_symlinks,
@@ -3198,6 +3199,7 @@
Operational functions [fs.op.funcs]
copy_options::skip_existing
, copy_options::overwrite_existing
or copy_options::update_existing
;copy_options::synchronize_data
or copy_options::synchronize
;copy_options::ignore_attribute_errors
;copy_options::recursive
;copy_options::copy_symlinks
or copy_options::skip_symlinks
;copy_options::directories_only
, copy_options::create_symlinks
or copy_options::create_hard_links
.Operational functions [fs.op.funcs]
options
must contain at most one option from each of the following groups:
copy_options::skip_existing
, copy_options::overwrite_existing
or copy_options::update_existing
;copy_options::synchronize_data
or copy_options::synchronize
.copy_options::synchronize_data
or copy_options::synchronize
;copy_options::ignore_attribute_errors
.
Effects: Report an error if: @@ -3303,11 +3306,11 @@
exists(to) && (options & copy_options::skip_existing) != copy_options::none
, orexists(to) && (options & copy_options::update_existing) != copy_options::none
and last write time of from
is more recent than that of to
.exists(to) && (options & copy_options::update_existing) != copy_options::none
and last write time of to
is more recent than that of from
.from
resolves to are copied to the file to
resolves to; thenfrom
resolves to are copied to the file to
resolves to. If copying file attributes (but not contents) fails with an error and (options & copy_options::ignore_attribute_errors) != copy_options::none
then that error is ignored. After that,(options & copy_options::synchronize) != copy_options::none
, the written data and attributes are synchronized with the permanent storage; otherwise(options & copy_options::synchronize_data) != copy_options::none
, the written data is synchronized with the permanent storage.[Note: The overloads taking copy_option
are deprecated. Their effect is equivalent to the corresponding overloads taking copy_options
after casting the options
argument to copy_options
.]
[Note: When copy_options::update_existing
is specified, checking the write times of from
and to
may not be atomic with the copy operation. Another process may create or modify the file identified by to
after the file modification times have been checked but before copying starts. In this case the target file will be overwritten.]
[Note: The copy_options::synchronize_data
and copy_options::synchronize
options may have a significant performance impact. The copy_options::synchronize_data
option may be less expensive than copy_options::synchronize
. However, without these options, upon returning from copy_file
it is not guaranteed that the copied file is completely written and preserved in case of a system failure. Any delayed write operations may fail after the function returns, at the point of physically writing the data to the underlying media, and this error will not be reported to the caller.]
[Note: The copy_options::ignore_attribute_errors
option can be used when the caller does not require file attributes to be copied. The implementation is permitted to make an attempt to copy the file attributes, but still succeed the file copying operation if that attempt fails. This option may be useful with file systems that do not fully support operations of file attributes.]
void copy_symlink(const path& existing_symlink, const path& new_symlink); void copy_symlink(const path& existing_symlink, const path& new_symlink, system::error_code& ec);diff --git a/doc/release_history.html b/doc/release_history.html index 598066480..47d0cf6e7 100644 --- a/doc/release_history.html +++ b/doc/release_history.html @@ -47,6 +47,7 @@
absolute
now returns a path with a trailing directory separator when the input path has an empty relative_path()
. (#301)unique_path
overload taking a single error_code& ec
argument. The overload generates a unique path using the default path model.weakly_canonical
now produces an absolute path if the input path is relative and contains no elements that exist in the filesystem. (#300)copy_options::ignore_attribute_errors
option for copy_file
and copy
operations. The new option allows to ignore possible errors while copying file attributes. (#179)copy_file
backends based on sendfile
and copy_file_range
system calls will attempt to preallocate storage for the target file. This may reduce filesystem fragmentation and provide early error indication if there is not enough free space. Not all filesystems support this feature; file copying proceeds if storage preallocation is not supported.