Closed CedricDC closed 2 years ago
Thank you for the detailed report, I'll look into it.
@CedricDC Please replace line https://github.com/gulrak/filesystem/blob/7bc5c17305fe70518ca72162e244af1d12455a91/include/ghc/filesystem.hpp#L4743
to
auto fs = symlink_status(p, tec);
and run your test.
This is indeed be fixed by #135 and I want to thank @phprus for his repeated supportive work.
Hi!
The call to
ghc::filesystem::remove_all(path)
(same with the version with thestd::error_code
) appears to fail when "path" is a symlink on a read-write filesystem that points to a non-empty directory on a read-only filesystem. It works correctly when the symlink target is a file or if the target directory is empty. The call returns an error with the "Read-only file system" message.Tested on Ubuntu 18.04 with gcc 9.2.0 with filesystem 1.0.8 as well as current master. Using
std::filesystem
instead, the symlink is deleted as expected.Test procedure:
remove_all
Sample executable:
Thanks!