![]() |
initial_path
as deprecated and removed from v4. Use
the non-templated versions instead.
readdir instead of
readdir_r on more POSIX
platforms, specifically on Mac OS and other Apple operating systems, FreeBSD,
OpenBSD, DragonFly BSD, NetBSD, QNX 6.0 and later, Solaris 10 and later
and Illumos-based systems. Solaris users with gcc are recommended to define
__SunOS_5_x macros according
to their target Solaris version (e.g. __SunOS_5_11)
when building Boost. (#349)
readdir
is deprecated and will be removed in a future release. Although not required
until POSIX.1-2024,
on modern systems readdir
is thread-safe when used with separate DIR
objects in different threads and on some systems readdir_r
is marked as deprecated. POSIX.1-2024 has been updated accordingly and
also marked readdir_r as
obsolescent, with a planned removal in a future version of the specification.
EINTR
error code returned from opendir,
readdir and equivalents.
Although not documented, this error code, reportedly, may be returned on
Apple operating systems and some BSD systems.
BOOST_FILESYSTEM_POSIX_API and BOOST_FILESYSTEM_WINDOWS_API. The old
BOOST_POSIX_API and BOOST_WINDOWS_API macros are still defined
by Boost.System. Boost.Filesystem will check that the two sets of macros
are in sync and by default will fail to compile if not. The compilation
error can be reduced to a warning by defining BOOST_FILESYSTEM_ALLOW_SYSTEM_API_MISMATCH
to 1 or disabled entirely by defining it to 2. Note that in this case the
error code values reported by Boost.Filesystem will not match the error
category.
openat
and related APIs, fixed an error reported by recursive_directory_iterator
increment when the iterator encounters a dangling symlink and following
symlinks is disabled.
path::value_type type has changed from
wchar_t to char. As on other POSIX platforms,
wide character paths will be converted to the narrow character encoding
using the locale set by path::imbue.
Note that since Cygwin is running on top of Windows, it will also
perform character code conversion internally. It is important that
locale in the Cygwin environment is configured correctly.
file_type::reparse_file
will not be reported for files. Reparse point handling is dependent
on Cygwin runtime behavior.
errno values.
read/write loop implementation of copy_file and copy
for configfs, securityfs, cgroup and cgroup2 filesystems, in addition to
the previously blacklisted filesystems.
canonical is
now based on the GetFinalPathNameByHandleW
WinAPI function. As a side effect, drive letters are converted to upper
case, which makes the resulting paths more interoperable. (#325)
canonical
no longer produces a trailing directory separator in the resulting path,
if the input path has one.
path constructor or
member function is called with an argument of a user-defined type that
is convertible to path
and one or more Source types, the conversion to
path is now chosen by default.
This may resolve argument conversion ambiguities in some cases, but may
also result in a less optimal conversion path. If a different conversion
path is desired, users are recommended to use explicit type casts. (#326)
dirfd
being a macro on FreeBSD 9 and older. (#328)
is_empty operation is now
better protected against concurrent filesystem modifications.
is_empty
now indicates error if invoked on a file other than a regular file or a
directory.
file_size
and is_empty operating
on symlinks rather than the files the symlinks refer to. (#313)
directory_entry::refresh no longer throws an exception
if the file referenced by the entry doesn't exist. This makes directory_entry::status and directory_entry::symlink_status,
as well as methods based on them, behave similarly to the equivalent standalone
operations. The fact that the file does not exist is still indicated via
the error_code returned
by the corresponding directory_entry::refresh
overload, or can be seen by testing if the file type returned by directory_entry::status or directory_entry::symlink_status
calls is file_type::file_not_found. (#314)
path::generic_path and path::generic_string
methods now remove duplicate directory separators in the returned paths.
path::generic_path,
path::generic_string, path::make_preferred
and path::lexically_normal avoid converting between
backslashes and forward slashes in path root names. For example, on Windows,
path("\\\\?\\c:\\foo").generic_string()
now returns "\\?\c:/foo" instead of "//?/c:/foo".
Similarly, path("\\\\host/share/foo/..").lexically_normal()
now returns "\\host\share".
equivalent
now indicates error if either one of the paths doesn't exist.
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.
fdopendir, openat
and related APIs defined in POSIX.1-2008, as well as on Windows, recursive_directory_iterator now uses
file descriptors/handles instead of paths to query the file statuses and
open nested directories during iteration. This makes directory iteration
more resilient to concurrent modifications of the filesystem.
path and recursive_directory_iterator member functions,
is_regular, copy_directory, symbolic_link_exists,
complete, copy_option, symlink_option,
as well as boost/filesystem/convenience.hpp and boost/filesystem/path_traits.hpp
headers were removed. Possible replacements for the removed components
are mentioned in Deprecated
names and features section.
path construction,
assignment and appending from container types (e.g. std::vector<char>) is now disabled by default. Users
can still enable this functionality by defining BOOST_FILESYSTEM_DEPRECATED.
This functionality remains deprecated and will be completely removed in
a future release.
directory_entry
observers taking error_code& ec
argument did not clear the error code on successful return. (#291)
boost/filesystem/string_file.hpp header. The header was deprecated
since Boost.Filesystem 1.79.0.
directory_entry::refresh
method that updates internal cached file statuses for the directory entry
identified by path.
directory_entry
constructors and modifiers that initialize or modify the path now automatically
call refresh. This may
result in errors that were not indicated before and in v3,
if querying the filesystem for file statuses fails (e.g. if the file does
not exist). This new behavior is similar to std::filesystem.
directory_entry
constructors and methods taking file_status
parameters are removed. Users are recommended to remove these arguments
and rely on directory_entry
calling refresh internally.
directory_entry member
methods for checking the file type of the file, similar to std::filesystem.
is_block_file,
is_character_file, is_fifo, is_socket
and is_reparse_file.
recursive_directory_iterator
is now more likely to reuse information about the file type that is obtained
during filesystem iteration. This may improve performance. (#288)
boost/filesystem/fstream.hpp
are now movable, if the standard library file streams are. (#280)
boost/filesystem/cstdio.hpp
with a portable fopen overload
that takes path as the
first argument. This function is equivalent to std::fopen,
except that on Windows it uses the native wide character encoding for paths.
path comparison
operators are now more restricted to avoid potential ambiguities when user's
code contains a using namespace
boost::filesystem;
directive. (#285)
path constructors from iterators could
interfere with function overloads taking a std::initializer_list
argument. (#287)
path
conversion constructors being too permissive on the accepted arguments.
(#273)
path::remove_filename
now presesrves the trailing directory separator. (#271)
path::remove_filename_and_trailing_separators,
which removes the filename and directory separators preceding it from the
path. This behavior is similar to path::remove_filename
in Filesystem v3, but is also usable in
v4.
path::replace_filename, which replaces filename
in a path.
path
construction, assignment and appending from containers of characters, such
as std::vector<char>
or std::list<wchar_t>,
is deprecated in v3 and removed in v4. Please use string types or iterators instead.
boost/filesystem/path_traits.hpp
header is deprecated and will be removed in a future release. The header
contained implementation details of path
and should not be used in user's code.
BOOST_FILESYSTEM_ALLOW_DEPRECATED
macro can be defined when compiling user's code.
*at
APIs. (#250)
ERROR_INVALID_PARAMETER
when constructing directory iterators. (PR#246)
weakly_canonical
failing with an ERROR_INVALID_FUNCTION
error code if the path started with the "\\?\"
prefix. (#247)
std::string_view, boost::string_view
and boost::container::string (as well as respective wchar_t counterparts) in path
constructors, assignment and appending operations. (#208)
path constructors, assignment
and appending operations taking a pair of iterators will no longer accept
iterators with value types that are not one of the supported path character
types.
directory_iterator
with various mounted filesystems and Wine releases prior to 7.21. (#255)
ERROR_ACCESS_DENIED
error. This may allow status
and symlink_status to succeed
for system files and directories that are not reparse points or symlinks.
(#234)
ERROR_INVALID_PARAMETER
when querying file attributes. This affected status
and symlink_status, which
reported that files do not exist, and directory iterators, which failed
to construct, as well as other dependent operations. (#236)
sendfile
copy_file implementation
if copy_file_range failed
with ENOSYS in runtime.
The sendfile fallback implementation
used to skip the filesystem type check and could fail for some filesystems.
openat
and related APIs defined in POSIX.1-2008 and on Windows Vista and later,
improved protection of remove_all
against CVE-2022-21658
that was implemented in the previous release. The previous fix could still
result in removing unintended files in certain
conditions. Other systems remain vulnerable.
path::replace_extension
now works in terms of v3 definition of
path::extension rather than v4.
path
or compatible string type. (#223)
fdopendir and O_NOFOLLOW and on Windows, remove_all is now protected against
CVE-2022-21658.
The vulnerability is a race condition that allows a third party process
to replace a directory that is being concurrently processed by remove_all with a directory symlink and
cause remove_all to follow
the symlink and remove files in the linked directory instead of removing
the symlink itself. (#224)
remove and
remove_all implementation,
use POSIX semantics for file removal, when supported by the OS (Windows
10 1709 and later). When POSIX semantics is supported, the file name is
removed from the filesystem namespace as soon as the file is marked for
deletion, even if it is still open and in use. With legacy Windows semantics,
the file name remains present in the the filesystem namespace until the
last file handle to the file is closed, which allows the file marked for
deletion to be opened and prevents creating new files with the same name.
(#216)
remove and
remove_all now support
deleting read-only directories. Support for removing read-only non-directory
files was added previously.
directory_iterator
internal implementation has been reworked to better utilize modern Windows
APIs, which may improve performance while handling symlinks.
resize_file
should no longer fail with an error if the file to be resized is opened.
statx
syscall on Android prior to 11.0 (API version 30). The syscall is blacklisted
by seccomp and causes process termination in runtime. (#229)
boost/filesystem/string_file.hpp
header is deprecated and will be removed in a future release. The header
is no longer included by boost/filesystem.hpp
by default. Users are advised to implement the functionality themselves
or migrate to other implementations.
path::filename
and path::iterator no longer return an implicit
trailing dot (".") element if the path ends
with a directory separator. Instead, an empty path is returned, similar
to C++17 std::filesystem. This also affects other methods that are defined
in terms of iterators or filename, such as path::stem,
path::compare or lexicographical_compare.
For example, path("a/b/")
== path("a/b/.") no longer holds true. (#193)
path::lexically_normal
no longer produce a trailing dot (".") element
and omits a directory separator after a trailing dot-dot ("..")
element in the normalized paths.
path
append operations now consider root name and root directory in the appended
path. If the appended path is absolute, or root name is present and differs
from the source path, the resulting path is equivalent to the appended
path. If root directory is present, the result is the root directory and
relative path rebased on top of the root name of the source path. Otherwise,
the behavior is similar to v3. (#214)
path::lexically_normal now converts directory
separators to preferred separators in the root name of the normalized paths.
path::assign,
path::append, path::concat
and the corresponding operators to avoid unnecessary path copying and reduce
the amount of code redundancy.
absolute(p,
base)
returning a path with root name base.root_name() if p
starts with a root directory. In such a case p
is already an absolute path and should be returned as is.
create_directories no longer
reports an error if the input path consists entirely of dot (".")
and dot-dot ("..") elements. The implementation
is no longer using recursion internally and therefore is better protected
from stack overflow on extremely long paths.
remove now
supports deleting read-only files. The operation will attempt to reset
the read-only attribute prior to removal. Note that this introduces a possibility
of the read-only attribute being left unset, if the operation fails and
the original value of the attribute fails to be restored. This also affects
remove_all. (#216)
remove_all now returns
static_cast<
uintmax_t >(-1) in case
of error, similar to C++17 std::filesystem.
boost/filesystem/path.hpp
but not boost/container_hash/hash.hpp and the compiler is set to preserve
unused inline functions. (#215)
Introducing Boost.Filesystem v4. This new
version of the library removes all deprecated features of v3 and also makes
a number of breaking API changes intended to make Boost.Filesystem more compatible
with std::filesystem introduced in C++17 (original proposal: ISO
C++ File System Technical Specification). The differences are described
in the release notes and documentation using v3
and v4 tags and are also summarised in a
separate section. Users can select Boost.Filesystem
version by defining BOOST_FILESYSTEM_VERSION
macro to either 3 or 4 when compiling their code.
There is no need to separately compile Boost.Filesystem for each library version — a single binary supports both v3 and v4. Users should avoid using both v3 and v4 in the same application as this can lead to subtle bugs.
Currently, v3 is the default. In a future release v4 will become the default, and eventually v3 will be removed. v4 is functional, but it is still a work in progress and there may be breaking API changes in the future.
Other changes in this release include:
path::filename,
path::stem and path::extension
no longer consider root name or root directory of the path as a filename
if the path only consists of those components. For example, on Windows
path("C:").filename()
used to return "C:" and path("C:\\").filename() used to return "\"
and both will return an empty path now. (#88)
path::stem
and path::extension no longer treat a filename
that starts with a dot and has no other dots as an extension. Filenames
starting with a dot are commonly treated as filenames with an empty extension.
The leading dot is used to indicate a hidden file on most UNIX-like systems.
(#88)
"\\.\")
and experimental support for NT path prefix ("\??\").
The prefixes will be included in the root name of a path. Note that using
the prefixes with Boost.Filesystem v3 can lead to surprising results (e.g.
path("\\\\.\\").stem() == "\\\\").
It is recommended to use the prefixes only with Boost.Filesystem v4.
path::lexically_normal implementation to eliminate
some cases of duplicate dot (".") elements
in the normalized paths.
statx and getrandom
system calls on Linux. This can be useful if the syscall is present at
compile time but fails with ENOSYS
at run time (for example, in Docker containers that restrict the syscall,
even if available on the host). (#172)
copy_options::synchronize_data
and copy_options::synchronize options for the copy_file operation. These options allow
to synchronize the written data and attributes with the permanent storage.
These options are expensive in terms of performance, but allow to ensure
reliability of the copied data. Note that copy_file
performed implicit data synchronization on POSIX systems since Boost.Filesystem
1.74.0. This release adds support for more platforms and disables data
synchronization by default while allowing the caller to explicitly request
it. (#186)
EINTR
error code on POSIX systems for some system calls issued internally. In
particular, EINTR could
have been ignored on close,
which on HP-UX would result in a leaked file descriptor.
copy_file implementations
based on Linux sendfile
and copy_file_range system
calls, added handling of error codes indicating that a particular filesystem
does not support the system call and fall back to the generic read/write
loop. This should fix copy_file
failing on eCryptFS and
possibly other filesystems. (#184)
copy_file_range system
call is now used since Linux kernel 4.5, whereas previously it was only
enabled since 5.3. The copy_file
implementation will fall back to sendfile
or read/write
loop if copy_file_range
fails to copy a given file across filesystems.
copy_file implementations
based on Linux sendfile
and copy_file_range system
calls will not be used on filesystems that are known to contain files with
generated content. These system calls are incompatible with such files,
and copying them would result in zero-sized files. The generic read/write
loop will be used instead. Currently, the blacklisted filesystems are:
procfs, sysfs, tracefs and debugfs.
copy_file implementation
based on read/write loop, increased the maximum size
of the buffer used for temporary storage and take into account the target
filesystem block size for more optimal performance.
current_path
to obtain the current path for a process will now fail with an error instead
of returning successfully with a root path. This platform does not support
current directory. Changing the current path was already failing similarly
in previous releases of Boost.Filesystem.
canonical, fixed the
check for a symlink referencing a directory above root, if an earlier symlink
was resolved to an absolute path with a different root from the original
path.
canonical, added a limit
for the maximum number of symlinks that can be resolved during the call.
The limit is currently at least 40 symlinks.
canonical and
weakly_canonical will now
use path::preferred_separator for the root directory
separator in the resulting paths. This fixes "file not found"
errors caused by Windows API not handling generic separators in UNC paths
and paths that start with the Win32 filesystem prefix ("\\?\").
(#87)
weakly_canonical
overloads taking base path
as an argument.
weakly_canonical
no longer fails with an error if the input path contains elements that
do not exist in the filesystem but are cancelled by a subsequent dot-dot
("..") element. For example, weakly_canonical("C:\\a\\..")
would previously fail if "C:\a" directory
did not exist. (#201)
read_symlink on Windows,
corrected reparse point handling. The operation would return an empty path
for some mount points (for example, created by Box
cloud storage driver) and directory junction points that had empty print
names. The new implementation now parses substitute name of the reparse
point and attempts to reconstruct a Win32 path from it. (#187)
boost/filesystem/fstream.hpp
will use wide character paths on libc++ versions 7.0 and higher, when the
standard library supports opening files with wide character paths. (#181)
path::imbue.
The supported compilers include MSVC, GCC and Clang, as well as other compilers
that support customizing program initialization order through #pragma section
(for MSVC-compatible compilers) or __attribute__
((init_priority)) (for GCC-compatible compilers).
path::remove_filename
if the path is "////". (#176)
create_directories
disregarding errors from file status query operations issued internally.
This could result in incorrect error codes returned by create_directories.
(#182)
creation_time
operation, which allows to obtain file creation time. (Inspired by PR#134)
last_write_time(p,
ec)
operation in case of failure has been changed to a minimal value representable
by std::time_t instead of -1.
hard_link_count(p,
ec)
operation in case of failure has been changed to static_cast<uintmax_t>(-1)
instead of 0.
file_size
will now indicate error code errc::function_not_supported
if the path resolves to a non-regular file. Previously, errc::operation_not_permitted
was reported.
statx
system call internally, when possible, which allows to reduce the amount
of information queried from the filesystem and potentially improve performance.
The statx system call was
introduced in Linux kernel 4.11.
const-qualification
from return types of some path
methods. This could prevent move construction and move assignment at the
call site in some cases. (#160)
statvfs
system call to obtain filesystem space information. (Inspired by PR#162)
space now returns
with an error if the provided path does not idendify an existing file.
(#167)
canonical
and read_symlink on Windows.
This also affects other algorithms that involve canonical
and read_symlink in their
implementation. (PR#100,
#99)
read_symlink
on Windows could potentially fail or cause failures elsewhere with a sharing
violation error, if the same symlink was opened concurrently. (#138)
is_symlink(directory_entry)
would always return false,
even if the directory entry actually referred to a symlink. (PR#148)
directory_entry
and error_code (e.g. is_directory(directory_entry,
error_code&)).
Removed incorrect noexcept
specifications for the overloads not taking the error_code
arguments.
copy_file implementation
has been updated to perform checks on the source and target files, as required
by C++20 ([fs.op.copy.file]/4.1). In particular, the operation will fail
if the source or target file is not a regular file or the source and target
paths identify the same file.
copy_file on POSIX systems
will now also copy the source file permissions to the target file, if the
target file is overwritten.
copy_file
implementations based on sendfile
and copy_file_range system
calls on Linux, which may improve file copying performance, especially
on network filesystems.
copy_option
enumeration that is used with the copy_file
operation is deprecated. As a replacement, the new enum copy_options
(note the trailing 's') has been added. The new enum contains values similar
to the copy_options enum
from C++20. The old enum values are mapped onto the new enum. The old enum
will be removed in a future release.
copy_options::skip_existing
option, which allows copy_file
operation to succeed without overwriting the target file, if it exists.
copy_options::update_existing
option, which allows copy_file
operation to conditionally overwrite the target file, if it exists, if
its last write time is older than that of the replacement file.
copy_file
now returns bool, which indicates
whether the file was copied.
copy
operation has been extended and reworked to implement behavior specified
in C++20 [fs.op.copy]. This includes support for copy_options::recursive,
copy_options::copy_symlinks, copy_options::skip_symlinks,
copy_options::directories_only, copy_options::create_symlinks
and copy_options::create_hard_links options. The operation
performs additional checks based on the specified options. Applying copy to a directory with default copy_options will now also copy files
residing in that directory (but not nested directories or files in those
directories).
create_directory
overload taking two paths. The second path is a path to an existing directory,
which is used as a source of permission attributes to use in the directory
to create.
copy_directory
operation has been deprecated in favor of the new create_directory
overload. Note that the two operations have reversed order of the path
arguments.
equivalent on POSIX systems
now returns the actual error code from the OS if one of the paths does
not resolve to a file. Previously the function would return an error code
of 1. (#141)
equivalent no longer considers
file size and last modification time in order to test whether the two paths
refer to the same file. These checks could result in a false negative if
the file was modified during the equivalent
call.
absolute
overloads taking error_code
argument.
current_path() as the default value of their arguments
and also have an error_code
argument will use the current_path(error_code& ec) overload to obtain the current path, so
that its failure is reported via the error_code
argument instead of an exception.
space now initializes the
space_info structure members
to -1 values on error, as required by C++20 ([fs.op.space]/1).
space on Windows now accepts
paths referring to arbitrary files, not only directories. This is similar
to POSIX systems and corresponds to the operation description in C++20.
(#73)
temp_directory_path for Windows CE. (PR#25)
unique_path operation based on getrandom (Linux), arc4random_buf
(OpenBSD/FreeBSD/CloudABI) and BCrypt (Windows) system APIs.
filesystem_error
to exception.hpp; file_status
and associated enums and functions to file_status.hpp;
directory_entry, directory_iterator and recursive_directory_iterator to directory.hpp.
operations.hpp still includes the new headers exception.hpp, file_status.hpp
and directory.hpp, unless BOOST_FILESYSTEM_NO_DEPRECATED
macro is defined. These implicit includes are considered deprecated and
will be removed in a future release. Users are encouraged to include the
new headers directly or include filesystem.hpp.
filesystem_error exception
is now implemented in the compiled library of Boost.Filesystem. Users may
need to add linking with Boost.Filesystem library in their projects.
utimensat
instead of utime. utime is declared obsolete in POSIX.1-2008
and can be disabled e.g. in uClibc-ng. (PR#115)
directory_iterator is now
left in the end state on memory allocation errors.
directory_iterator on
POSIX systems, support for readdir/readdir_r has been reworked to avoid
memory allocations for dirent
structures when readdir
is used. This reduces memory consumption and eliminates the possibility
of buffer overruns in case if readdir
produces a very long directory name.
directory_options
enum, which reflects the same named enum from C++20. The enum is supported
in directory_iterator and
recursive_directory_iterator
to customize iteration behavior. In particular, the iterators now support
skipping directories that can't be opened due to insufficient permissions.
The symlink_option enum
is now deprecated and should be replaced with directory_options.
recursive_directory_iterator
is now reset to the end state in case of errors, as required by C++20.
(#112)
directory_options::pop_on_error
option, which configures recursive_directory_iterator
so that it attempts to recover from iteration errors by repeatedly invoking
pop()
until it succeeds or the end state is reached. (#113)
directory_options::skip_dangling_symlinks
option, which configures recursive_directory_iterator
so that it doesn't follow dangling directory symlinks and continues iteration
instead of reporting an error.
recursive_directory_iterator
are now marked as deprecated: level(), no_push_pending(), no_push_request(), no_push(). Users are advised to replace their use
with the standard counterparts: depth(), recursion_pending(), disable_recursion_pending(). Note that recursion_pending() has the opposite meaning compared to
no_push_pending()
and no_push_request().
Deprecated methods will be removed in a future release.
path::lexically_relative (and any dependent
algorithms) to correctly handle empty, dot and dot-dot path elements in
its argument. The behavior is made closer to C++17 std::path::lexically_relative
in that empty and dot path elements are ignored and dot-dot path elements
are accounted by decreasing the number of dot-dot path elements to generate
in the resulting relative path. (#76)
error_code
returned from directory iterator increment when readdir_r
is used.
path, fixed rvalue-aware
operator/
return type to return an rvalue instead of rvalue reference. This fixes
leaving a dangling reference in the user's code if the result of operator/
is bound to a const reference. (#110)
std::string::end() in path implementation.
error_code. (#58)
path. (#12759)
current_path and
read_symlink implementation
to avoid possible memory exhaustion on broken or tampered with filesystems.
The functions now have an internal limit of the path size they will accept
from the OS, which is currently 16 MiB.
copy_file.
readdir_r on
Linux and Android since the readdir
function is already thread-safe. (PR#68,
#72)
boost::filesystem::copy
due to undefined behavior in the implementation. (PR#71)
boost::filesystem::directory_iterator
implementation. (PR#77)
BOOST_FOREACH.
is_empty()overload
with error_code parameter
should not throw on error. Thanks to ldqrk for pull request PR#42.
space(p,
ec).
Thanks to cmuellner for pull request PR#39.
test/config_info.cpp to increase macro state reporting
in hopes of easing debugging on remote machines.
operations_test failure
on MinGW: MinGW defines __MINGW32__
rather than _MSC_VER, so
also test for __MINGW32__
to see if setenv/unsetenv workaround needed.
generic() function name: The undocumented
experimental class path
member function generic() has been renamed generic_path(). Fixes #11855.
Unless the macro BOOST_FILESYSTEM_NO_DEPRECATED
is defined, the original generic() will continue to be supplied as a workaround
for existing user code. But generic() is deprecated. User code should migrate
to the new name.
path
adds constexpr constants separator
and dot of the type appropriate
for the platform, and adds query functions path::filename_is_dot
and path::filename_is_dot_dot.
These add convenience and the implementations may be more efficient that
user coded equivalent functions.
directory_iterator
and recursive_directory_iterator
equality testing has existed more than a dozen years. Nowadays test driven
development would likely have detected the problem in early development.
Sigh.
create_directory(). Charles Olivi submitted a pull request
with some particularly helpful test cases.
path
member functions stem(),
extension().
Thanks to faithandbrave for pull request PR#31.
push_directory()internal logic so it is easier to reason
about.
path::lexically_normal,
path::lexically_relative,
relative,
and weakly_canonical.
Many thanks to Jamie Allsop for his help and perseverance. Resolves tickets
#1976,
#6249.
path
now has path::reverse_iterator, path::const_reverse_iterator,
path::rbegin,
and path::rend.
noexcept
supplied as specified in the Filesystem TS if supported by the compiler.
path::size
function to class path.
Resolves #6874.
unique_path
by applying PR#15
from Sebastian Redl. Also fixes #7506,
unique_path Fails
on Windows for Temporary User Profiles.
file_status
and recursive_directory_iterator:
C++ turns an explicit constructor with all arguments except first defaulted
into non-explicit single argument constructor.
BOOST_FILESYSTEM_NO_DEPRECATED
is defined, by applying a patch submitted by Makesim.
remove().
path::parent_path
and path::filename
sections of the reference docs.
"."
at the end of a path that ends with a slash
path reverse iteration feature.
The reference documentation has also been updated with a
note warning about the limitations of class path iterators.
BOOST_SCOPED_ENUM
to a compiled function because it will result in an undefined reference
if the library is compiled with -std=c++0x but the use is compiled in C++03
mode, or visa versa.
temp_directory_path() to (1) avoid GetTempPath() failure if path length > 130 (ticket
#5300)
and (2) provide a more sensible sequence of directories than provided by
GetTempPath(),
per boost list discussion "[filesystem] temp_directory_path() behavior
on Windows". The new sequence is:
%TMP%
%TEMP%
%LOCALAPPDATA%/Temp
%USERPROFILE%/Temp
GetWindowsDirectoryW()/Temp
path locale
and codecvt implementation for increased reliability. This change was SVN
revision 83021, which should have gone into 1.56.0 but unfortunately the
merge didn't happen until too late.
codecvt
facets.
char-to-wchar_t or wchar_t-to-char is attempted in an environment without
a valid C locale (for example, if the LANG
environment variable is invalid or not defined).
mklink /j link target". There is
no plan for Boost.Filesystem to be able to create them directly other than
by calling std::system().
recursive_directory_iterator::increment,
adding an invariant that progress is always made, even if an error is reported
by exception or error_code. Add a manually executed test, test/issues/recurse_dir_iter_5403.cpp. Adjust regular regression tests
as needed. Thanks to Claudio Bley for the PR#4
- the change was incorporated into the reorganized code. Fixes #5403.
canonical()
to treat parent of root as root. (Christian Hammerl) Fixes #9683
and #10187.
__sun
macro which is defined on Solaris 10. (Chris Stylianou)
const char
colon to clear clang warning.
(J?gen Hunold)
class filesystem_error.
perms::all_all and perms::perms_mask
to absolute values to quiet intellisense warnings, and conform to C++11.
path::codecvt()
and path::imbue()
with portable code that is intended to be much more robust and maintainable.
A section on path usage
concerns has been added to the reference documentation describing
several concerns that arise in the context of multithreading and path::codecvt().
path::filename()
and path::parent_path()
to fail on Windows for path(":"), and that in turn caused other functions
that depend on filename() or parent_path() to fail, such as create_directories().
begin()
and end()
non-member functions for directory_iterator
and recursive_directory_iterator
so that C++11 range-based for
statements work. Suggested by feature requests #5896,
using the #5896
approach.
range_begin()
and range_end()
non-member functions for directory_iterator
and recursive_directory_iterator
so that BOOST_FOREACH works.
fchmodat problem
affecting symlink permissions reported during discussion of #6659.
constexpr value_type
preferred_separator to class
path.
<sys/stat.h>
is no longer included.
compare
for consistency with std::string.
BOOST_FILESYSTEM_DYN_LINK
and BOOST_FILESYSTEM_STATIC_LINK
logic in filesystem/config.hpp so that one or the other is always
defined, and both being defined is an #error.
codecvt
thread safety problems #4889,
for these compilers if static linking is used.
path::operator+=
and concat functions to tack on things like suffixes or numbers. Suggested
by Ed Smith-Rowland and others.
MOVEFILE_COPY_ALLOWED
to deal with renames across drives, volumes, file systems. Fix has no effect
on non-Windows systems.
locale
and codecvt facet back
to namespace scope. POSIX except OS X uses local static initialization
(i.e. lazy) to ensure exceptions are catchable if environmental variables
are misconfigured and to avoid use of locale("") if not actually used.
director_iterator
construction with error_code
argument that caused increment to be called without the ec
argument being passed.
path_test.cpp
code even though the ticket itself was not a defect, and clarifying docs;
iteration over a path yields generic format.
canonical,
suggested by David Svoboda, who also provided pseudo-code.
hash_value
function for paths. (Daniel James)
locale("")
exception being thrown before main() starts on poorly configured (e.g. LANG="bad name") POSIX systems. Resolves
the most serious aspect of tickets #4688,
#5289.
file_status.cpp added (V3). See boost-root/libs/filesystem/v3/example.
Useful both as an example and to explore how Boost.Filesystem treats various
status errors. Run "bjam" (NOT "bjam
install") in the example directory to install in example/bin.
iterator_facade.
(#4912)
<boost/config/user.hpp>
can be used to specify BOOST_FILESYSTEM_VERSION.
(#4891)
assert
with BOOST_ASSERT.
unique_path(). Instead, add a note mentioning the workaround
for lack of thread safety and possible change to cwd. unique_path() is just too convenient to deprecate!
BOOST_THROW_EXCEPTION.
status()
to report non-symlink reparse point correctly.
symlink_option to
recursive_directory_iterator,
allowing control over recursion into directory symlinks. Note that the
default is changed to not recurse into directory symlinks.
Boost 1.44.0 - June, 2010 - Internationalization via single class path. More uniform error handling.
Boost 1.34.0 - May, 2007 - Internationalization via basic_path
template.
Boost 1.30.0 - March, 2003 - Initial official Boost release.