updated build system
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
2024-08-24 16:17:10 -05:00
parent ea3d69a2ee
commit 8e39850558
3 changed files with 8 additions and 19 deletions

View File

@ -31,9 +31,6 @@ void change_to_process_directory();
[[nodiscard]] auto copy_directory_recursively(std::string from_path, [[nodiscard]] auto copy_directory_recursively(std::string from_path,
std::string to_path) -> bool; std::string to_path) -> bool;
[[nodiscard]] auto copy_file(std::string from_path,
std::string to_path) -> bool;
[[nodiscard]] auto [[nodiscard]] auto
get_directory_files(std::string path, bool oldest_first, get_directory_files(std::string path, bool oldest_first,
bool recursive = false) -> std::deque<std::string>; bool recursive = false) -> std::deque<std::string>;

View File

@ -495,7 +495,8 @@ void base_provider::remove_deleted_files() {
event_system::instance().raise<orphaned_file_detected>( event_system::instance().raise<orphaned_file_detected>(
item.source_path); item.source_path);
if (utils::file::reset_modified_time(item.source_path) && if (utils::file::reset_modified_time(item.source_path) &&
utils::file::copy_file(item.source_path, orphaned_file)) { utils::file::file(item.source_path)
.copy_to(orphaned_file, true)) {
event_system::instance().raise<orphaned_file_processed>( event_system::instance().raise<orphaned_file_processed>(
item.source_path, orphaned_file); item.source_path, orphaned_file);
} else { } else {

View File

@ -24,6 +24,7 @@
#include "types/repertory.hpp" #include "types/repertory.hpp"
#include "utils/collection.hpp" #include "utils/collection.hpp"
#include "utils/error_utils.hpp" #include "utils/error_utils.hpp"
#include "utils/file.hpp"
#include "utils/path.hpp" #include "utils/path.hpp"
#include "utils/string.hpp" #include "utils/string.hpp"
#include "utils/time.hpp" #include "utils/time.hpp"
@ -53,17 +54,6 @@ void change_to_process_directory() {
#endif #endif
} }
auto copy_file(std::string from_path, std::string to_path) -> bool {
from_path = utils::path::absolute(from_path);
to_path = utils::path::absolute(to_path);
if (utils::file::file(from_path).exists() &&
not directory(to_path).exists()) {
return std::filesystem::copy_file(from_path, to_path);
}
return false;
}
auto copy_directory_recursively(std::string from_path, auto copy_directory_recursively(std::string from_path,
std::string to_path) -> bool { std::string to_path) -> bool {
from_path = utils::path::absolute(from_path); from_path = utils::path::absolute(from_path);
@ -85,8 +75,9 @@ auto copy_directory_recursively(std::string from_path,
utils::path::combine(to_path, {fd.cFileName})); utils::path::combine(to_path, {fd.cFileName}));
} }
} else { } else {
ret = copy_file(utils::path::combine(from_path, {fd.cFileName}), ret =
utils::path::combine(to_path, {fd.cFileName})); utils::file::file(utils::path::combine(from_path, {fd.cFileName}))
.copy_to(utils::path::combine(to_path, {fd.cFileName}));
} }
} while (ret && (::FindNextFile(find, &fd) != 0)); } while (ret && (::FindNextFile(find, &fd) != 0));
@ -105,8 +96,8 @@ auto copy_directory_recursively(std::string from_path,
utils::path::combine(to_path, {de->d_name})); utils::path::combine(to_path, {de->d_name}));
} }
} else { } else {
ret = copy_file(utils::path::combine(from_path, {de->d_name}), ret = utils::file::file(utils::path::combine(from_path, {de->d_name}))
utils::path::combine(to_path, {de->d_name})); .copy_to(utils::path::combine(to_path, {de->d_name}), true);
} }
} }