Skip to content

Commit

Permalink
Try catch on Temporary directory it.
Browse files Browse the repository at this point in the history
  • Loading branch information
herve-er committed Apr 18, 2024
1 parent 8a6d4ed commit 83821fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/libcommonserver/io/testio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ TemporaryDirectory::TemporaryDirectory() {
}

TemporaryDirectory::~TemporaryDirectory() {
//restore permissions
// restore permissions
for (const auto &entry : std::filesystem::recursive_directory_iterator(path)) {
std::filesystem::permissions(entry.path(), std::filesystem::perms::all, std::filesystem::perm_options::replace);
try {
std::filesystem::permissions(entry.path(), std::filesystem::perms::all, std::filesystem::perm_options::replace);
} catch (...) {
// Ignore
}
}
std::filesystem::remove_all(path);
}
Expand Down

0 comments on commit 83821fd

Please sign in to comment.