On Windows stat("foo/bar/../.") will resolve to "foo" even if that is a
non-directory and "foo/bar" does not exist. This is the expected
behaviour and consistent with boost::filesystem, so don't try to correct
it. The only unwanted behaviour is that stat("baz/") fails due to a
mingw bug (fixed in mingw-w64 v6.0.0) so add a workaround.
PR libstdc++/88881
* src/c++17/fs_ops.cc (canonical(const path&, error_code&))
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Normalize path, to match behaviour
of filesystem::exists.
(create_directories(const path&, error_code&)): Add assertions.
(status(const path&, error_code&)) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]:
Add workaround for bug in _wstat for paths with trailing slash.
* testsuite/27_io/filesystem/operations/create_directories.cc: Adjust
for expected behaviour on mingw.
* testsuite/experimental/filesystem/operations/create_directories.cc:
Likewise.
* testsuite/27_io/filesystem/operations/temp_directory_path.cc: Use
"TMP" instead of "TMPDIR" and clean environment before each test. Do
not test permissions on mingw targets.
From-SVN: r268034
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| algorithm | Loading commit data... | |
| any | Loading commit data... | |
| array | Loading commit data... | |
| chrono | Loading commit data... | |
| deque | Loading commit data... | |
| filesystem | Loading commit data... | |
| forward_list | Loading commit data... | |
| functional | Loading commit data... | |
| iterator | Loading commit data... | |
| list | Loading commit data... | |
| map | Loading commit data... | |
| memory | Loading commit data... | |
| memory_resource | Loading commit data... | |
| net | Loading commit data... | |
| numeric | Loading commit data... | |
| optional | Loading commit data... | |
| polymorphic_allocator | Loading commit data... | |
| propagate_const | Loading commit data... | |
| random | Loading commit data... | |
| ratio | Loading commit data... | |
| set | Loading commit data... | |
| source_location | Loading commit data... | |
| string | Loading commit data... | |
| string_view | Loading commit data... | |
| system_error | Loading commit data... | |
| tuple | Loading commit data... | |
| type_erased_allocator | Loading commit data... | |
| type_traits | Loading commit data... | |
| unordered_map | Loading commit data... | |
| unordered_set | Loading commit data... | |
| vector | Loading commit data... | |
| feat-cxx14.cc | Loading commit data... | |
| feat-lib-fund.cc | Loading commit data... |