updated build system
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
@ -31,9 +31,6 @@ void change_to_process_directory();
|
||||
[[nodiscard]] auto copy_directory_recursively(std::string from_path,
|
||||
std::string to_path) -> bool;
|
||||
|
||||
[[nodiscard]] auto copy_file(std::string from_path,
|
||||
std::string to_path) -> bool;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_directory_files(std::string path, bool oldest_first,
|
||||
bool recursive = false) -> std::deque<std::string>;
|
||||
|
@ -495,7 +495,8 @@ void base_provider::remove_deleted_files() {
|
||||
event_system::instance().raise<orphaned_file_detected>(
|
||||
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>(
|
||||
item.source_path, orphaned_file);
|
||||
} else {
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "types/repertory.hpp"
|
||||
#include "utils/collection.hpp"
|
||||
#include "utils/error_utils.hpp"
|
||||
#include "utils/file.hpp"
|
||||
#include "utils/path.hpp"
|
||||
#include "utils/string.hpp"
|
||||
#include "utils/time.hpp"
|
||||
@ -53,17 +54,6 @@ void change_to_process_directory() {
|
||||
#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,
|
||||
std::string to_path) -> bool {
|
||||
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}));
|
||||
}
|
||||
} else {
|
||||
ret = copy_file(utils::path::combine(from_path, {fd.cFileName}),
|
||||
utils::path::combine(to_path, {fd.cFileName}));
|
||||
ret =
|
||||
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));
|
||||
|
||||
@ -105,8 +96,8 @@ auto copy_directory_recursively(std::string from_path,
|
||||
utils::path::combine(to_path, {de->d_name}));
|
||||
}
|
||||
} else {
|
||||
ret = copy_file(utils::path::combine(from_path, {de->d_name}),
|
||||
utils::path::combine(to_path, {de->d_name}));
|
||||
ret = utils::file::file(utils::path::combine(from_path, {de->d_name}))
|
||||
.copy_to(utils::path::combine(to_path, {de->d_name}), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user