updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
@ -330,12 +330,16 @@ auto directory::remove() -> bool {
|
||||
static_cast<const char *>(__FUNCTION__),
|
||||
};
|
||||
|
||||
if (not exists()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return utils::retry_action([this]() -> bool {
|
||||
try {
|
||||
#if defined(_WIN32)
|
||||
return (not exists() || ::RemoveDirectoryA(path_.c_str()));
|
||||
return (::RemoveDirectoryA(path_.c_str()));
|
||||
#else // !defined(_WIN32)
|
||||
return not exists() || (rmdir(path_.c_str()) == 0);
|
||||
return (rmdir(path_.c_str()) == 0);
|
||||
#endif // defined(_WIN32)
|
||||
} catch (const std::exception &e) {
|
||||
utils::error::handle_exception(function_name, e);
|
||||
@ -353,6 +357,10 @@ auto directory::remove_recursively() -> bool {
|
||||
};
|
||||
|
||||
try {
|
||||
if (not exists()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (not traverse_directory(
|
||||
path_,
|
||||
[](auto dir_item) -> bool { return dir_item.remove_recursively(); },
|
||||
|
Reference in New Issue
Block a user