This fixes a problem that is_symlink(directory_entry) always returns
false, even if directory_entry is indeed a symlink. This change makes
is_symlink(directory_entry) behave the same as is_symlink(path) and
use symlink_status().
Instead of enabling/disabling the test compilation, define a macro when
mklink shell command is detected to be available. Test this macro
in all tests that use this command to create junctions and symlinks
on Windows.
Also, renamed reparce_tag_file_placeholder.cpp test to fix a spelling
error.
When the source path is not absolute and copy_options::create_symlinks is
specified, deduce the relative path from the target location to the source
file to create a symlink. This allows to copy to a path that is not the current
path.
Also, added absolute overloads taking error_code argyment.
Also, when current_path() is used as a default argument to other operations,
and the operation also accepts error_code, use current_path(ec) to report
errors through the error code rather than throwing an exception.
Also, added a test for copy operation.
The copy_file operation implementation has been inlined into the
detail::copy_file function. The part that copies the file body has been
extracted to a separate function, so that addition of specialized copy
implementations later is possible.
Added copy_options enum, which reflects the enum from C++20. Currently,
only overwrite_existing option is supported. Other options will be added
later.
The old enum copy_option is deprecated in favor of copy_options.
Updated docs to reflect recent changes to copy_file behavior.
space() now initializes space_info members to -1 values, which is used when the
structure is returned in case of error.
On Windows, check if the path refers to a directory, and use the parent
directory if not. In order to make sure we return space information for the
target filesystem, we have to resolve symlinks in this case.
Fixes https://github.com/boostorg/filesystem/issues/73.
For some unknown reason, Windows 8.1 system shell returns error code 1 when
invoking mklink to test if it exists. To work around this we now analyze
output of the command in the Jamfile. As an added bonus, the test is not
compiled when mklink is not supported.
The algorithm implementation now ignores empty and dot path elements in the
argument path and accounts dot-dot elements by decreasing the number of
dot-dot elements to generate in the resulting relative path. This is
according to C++17 std::path specification [fs.path.gen]/4.
Fixes https://github.com/boostorg/filesystem/issues/76.
The new option allows to skip dangling directory symlinks when iterating
over a directory using recursive_directory_iterator.
This also updates the operations_test, which failed spuriously because
the test created dangling symlinks for some of its checks. Since the order
of iteration is undefined, the tests sometimes passed, when the dangling
symlinks were encountered late during the iteration.
The directory_options enum reflects the same-named enum from C++20. It is now
supported by both directory_iterator and recursive_directory_iterator. In
particular, both iterators now support skip_permission_denied option.
recursive_directory_iterator is now set to end by default on errors, as
required by C++20. An additional directory_options::pop_on_error policy
is added to allow the iterator recover from an error. When this option is
specified and an error occurs, the iterator repeatedly pops the recursion level
until the pop completes successfully or the end state is reached.
recursive_directory_iterator that have standard counterparts (level,
no_push_pending, no_push_request and no_push) are now deprecated and can be
removed by defining BOOST_FILESYSTEM_NO_DEPRECATED. These members will be
removed in a future release.
Docs and tests updated accordingly. Also, in docs reconstructed release history
for the past releases from Boost release notes.
Fixes https://github.com/boostorg/filesystem/issues/112
Fixes https://github.com/boostorg/filesystem/issues/113
Directory iteration components were moved to separate files to simplify
maintenance of operations.hpp/cpp.
directory_iterator implementation on POSIX platforms has been reworked
to only allocate internal buffer when readdir_r is used. When readdir
is used, the dirent structure returned by readdir is used directly, which
eliminates the potential of buffer overrun in case if some directory name
exceeds the buffer size. This also removes the need to copy dirent members
into the buffer, which improves performance and simplifies maintenance.
For buffer size we now use the max path size as opposed to max filename
size. This is done to minimize the possibility of buffer overruns when
readdir_r is used.
On Windows, use Boost.WinAPI to configure the default target Windows version.
This removes WINVER and _WIN32_WINNT defines in Boost.Filesystem as these
macros should be defined by Boost.WinAPI now.
Additionally, exception.hpp and directory.hpp includes in operations.hpp are
marked as deprecated as operations.hpp do not need those components. Users
are encouraged to include the new headers explicitly in their code, as needed.
Apparently, slicing was intentional, and the test verified that it worked.
This commit restores the previous behavior and disables the gcc warning
instead.
When using Boost.Filesystem from a project compiled as C++/CX code,
compilation fails with a syntax error, because generic is a keyword.
error C2059: syntax error: 'generic'
See section "Generic interfaces" in C++/CX here:
https://msdn.microsoft.com/en-us/library/hh755792.aspx