On DragonFly BSD 6.4.0, std::locale("") fails unless LANG is set to some
locale that is supported in libc.
On Solaris 11.4, std::locale("") fails even if LANG is set correctly in
the environment. Recent versions of Solaris seem to have transitioned
to UTF-8 for filename encoding.
All BSD systems seem to have come to UTF-8 for path encoding by default,
so use utf8_codecvt_facet on all of them, plus Solaris.
Removed duplication of preprocessor checks for whether to use
utf8_codecvt_facet.
Check that BOOST_FILESYSTEM_POSIX/WINDOWS_API and BOOST_POSIX/WINDOWS_API
are defined in the same way and error out if not. Allow users to suppress
this check (and keep their code compiling) by defining
BOOST_FILESYSTEM_ALLOW_SYSTEM_API_MISMATCH to 1 to reduce the error to
a warning or to 2 to completely disable the check.
If we diverge in platform API selection with Boost.System again, we may
want to implement our own system category that is guaranteed to be in sync
with the platform API Boost.Filesystem actually uses. But for now the two
libraries are expected to be in sync, and the added check should do.
The tests that access Samba shares sometimes fail on Windows with
ERROR_NETNAME_DELETED. This error code does not tell whether the path
exists or not, so retry the test a few times until a definitive answer
is received.
This follows other Boost libraries (in particular, Boost.System) in
treating Cygwin as a POSIX platform rather than Windows. This is
a breaking change, but apparently downstream Boost.Filesystem packages
on Cygwin are patched to the same effect.
As part of this change, AT_NO_AUTOMOUNT is made an optional requirement
to enable POSIX *at APIs. This flag is not POSIX-standard and is not
supported on Cygwin, while *at APIs are.
Avoid indirectly calling refresh on the directory entry that we are
checking for whether we can descend into it. Calling refresh is
wasteful as it always queries both symlink_status and status and we
already have the actual symlink_status by the time we need status.
Rearranged code to group POSIX branches closer together and slightly
reduce code duplication.
This only affects POSIX platforms not supporting openat & co.
When the underlying directory iterator does not produce symlink status
during iteration, and the iterator points to a dangling symlink, the
recursive_directory_iterator increment would attempt to refresh file
statuses in the directory_entry. This would fail because the refresh
would query status in addition to symlink_status. This error was
wrongly reported to the caller if following symlinks was disabled for
the recursive iterator.
Fix this by only querying symlink_status. status is checked later,
if the iterator is configured to follow symlinks.
Because Boost.System has switched to define BOOST_POSIX_API on Cygwin[1],
Boost.Filesystem now defines its own set of macros for platform API
selection. At this time, we preserve the previous behavior, where
Cygwin is treated as Windows.
[1]: https://github.com/boostorg/system/pull/137
On Cygwin, NTE_BAD_SIGNATURE is defined as HRESULT, which is a signed
integer. This produces a signed/unsigned mismatch warning when it is
compared against a DWORD error code.
This error code is reported to be returned by
GetFileInformationByHandleEx(FileIdExtdDirectoryRestartInfo) in case of
Samba 3.0.2 share accessed from a Windows Server 2019 client, when
RequireSecuritySignature is set to 1 on the client. In the same setup,
GetFileInformationByHandleEx(FileBothDirectoryInformation) is reported
to succeed.
This doesn't seem to reproduce with Samba 4.19 server and Windows 10
client, so it may be specific to the client and server versions, or it
may be something else in the user's setup.
Add NTE_BAD_SIGNATURE to the list of errors on which we non-permanently
downgrade directory_iterator implementation to an older method.
Closes https://github.com/boostorg/filesystem/issues/334.
At least, gcc on Cygwin also emits the same bogus warnings about
missing dllimport attributes. Presumably, this may also be the case
for visibility attributes, so just disable the warning universally
on any gcc 12.
The warnings suppressed in header.hpp can be force-enabled by the user,
so disable the buggy warning in directory.hpp instead. Also make the
workaround more specific to MinGW.
Removed macos-12 job as the image has been removed from GHA. Added
new compilers and updated the old ones to avoid using external
package repositories. Added CMake testing with MinGW-w64.
Since the current and initial paths on Windows may have non-canonical
root paths (i.e. "c:\" instead of "C:\"), path comparisons may fail
because of the case differences between the canonicalized paths and
the expected paths. To avoid these spurious failures, canonicalize root
paths in all expected paths.
This forces the non-templated overloads accepting path to be chosen instead
of the templated members that expect arguments converible to Source.
This resolves overload resolution ambiguities, when the argument of a
user-defined type is convertible to path and multiple other types that qualify
as Source. By preferring the conversion to path we avoid testing other
conversion paths that may be ambiguous.
Fixes https://github.com/boostorg/filesystem/issues/326.
* Make the library modular usable.
* Use searched-lib targets for external/OS/Windows libraries to avoid trying to refer to mangled names for them. And hence failing to find them.
* Use the OS temp dir for creating test dir to avoid putting dirs in random location based on where one runs tests from.
* Switch to library requirements instead of source. As source puts extra source in install targets.
* Updated dependencies.
* Add missing NO_LIB usage requirements.
* Add missing import-search for cconfig/predef checks.
* Add requires-b2 check to top-level build file.
* Bump B2 require to 5.2
* Change all <source> references to <library>.
* Update copyright dates.
* Move inter-lib dependencies to a project variable and into the build targets.
* Split b2 dependencies into public and private.
* Undo temp dir for test change.
* Make winapi dep target-os specific. And remove direct atomic dep as it is already handled by conditional rule.
* Remove bug targets from all build as that's not a regular project.
This moves the common part of v3 and v4 canonical() to a separate
function and changes the Windows implementation to use
GetFinalPathNameByHandleW system call. As a side effect, this converts
drive names to upper case, which makes paths more interoperable.
Additionally, on POSIX systems, avoid adding a trailing directory
separator if the input path has one (which may be the case in v4). This
is consistent with libstdc++ and MSVC implementations of std::filesystem.
Fixes https://github.com/boostorg/filesystem/issues/325.