![]() |
Filesystem
Version 4 |
Home Tutorial Reference FAQ Releases Portability V4 V3 Intro V3 Design Deprecated Bug Reports |
Version 4 is a significant revision of the Boost Filesystem library that makes its interface and behavior closer to std::filesystem that was introduced in C++17 and updated in the later standards. It removes the features that were deprecated in Version 3 and makes a number of breaking changes.
Users can select Boost.Filesystem v4 version by defining BOOST_FILESYSTEM_VERSION
macro to 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.
path::filename
no longer returns root name or root directory if the path contains no
other elements. 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. This also affects path::stem
and path::extension
methods, as those are based on path::filename
.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.© Copyright Andrey Semashev, 2021
Distributed under the Boost Software License, Version 1.0. See www.boost.org/LICENSE_1_0.txt