mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
[#2] remove_all now counts directories too
This commit is contained in:
parent
217fb2bdf5
commit
4fbc6e18e2
@ -3628,7 +3628,7 @@ inline uintmax_t remove_all(const path& p, std::error_code& ec) noexcept
|
|||||||
if (ec) {
|
if (ec) {
|
||||||
return static_cast<uintmax_t>(-1);
|
return static_cast<uintmax_t>(-1);
|
||||||
}
|
}
|
||||||
return count;
|
return ++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void rename(const path& from, const path& to)
|
inline void rename(const path& from, const path& to)
|
||||||
|
@ -1983,7 +1983,7 @@ TEST_CASE("30.10.15.31 remove_all", "[filesystem][operations][fs.op.remove_all]"
|
|||||||
fs::create_directories("dir1/dir1b");
|
fs::create_directories("dir1/dir1b");
|
||||||
generateFile("dir1/dir1a/f1");
|
generateFile("dir1/dir1a/f1");
|
||||||
generateFile("dir1/dir1b/f2");
|
generateFile("dir1/dir1b/f2");
|
||||||
CHECK(fs::remove_all("dir1") == 2);
|
CHECK(fs::remove_all("dir1") == 5);
|
||||||
CHECK(fs::directory_iterator(t.path()) == fs::directory_iterator());
|
CHECK(fs::directory_iterator(t.path()) == fs::directory_iterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user