LibFileSystem: Add FileSystem::move_file

This is effectively a rename that falls back to a copy if the
destination is on a different mount point than the source.
This commit is contained in:
Shannon Booth 2023-07-06 20:49:14 +12:00 committed by Sam Atkins
commit a5fd80a336
Notes: sideshowbarker 2024-07-17 18:13:59 +09:00
2 changed files with 19 additions and 0 deletions

View file

@ -66,6 +66,7 @@ AK_ENUM_BITWISE_OPERATORS(PreserveMode);
ErrorOr<void> copy_file(StringView destination_path, StringView source_path, struct stat const& source_stat, Core::File& source, PreserveMode = PreserveMode::Nothing);
ErrorOr<void> copy_directory(StringView destination_path, StringView source_path, struct stat const& source_stat, LinkMode = LinkMode::Disallowed, PreserveMode = PreserveMode::Nothing);
ErrorOr<void> copy_file_or_directory(StringView destination_path, StringView source_path, RecursionMode = RecursionMode::Allowed, LinkMode = LinkMode::Disallowed, AddDuplicateFileMarker = AddDuplicateFileMarker::Yes, PreserveMode = PreserveMode::Nothing);
ErrorOr<void> move_file(StringView destination_path, StringView source_path, PreserveMode = PreserveMode::Nothing);
ErrorOr<void> remove(StringView path, RecursionMode);
ErrorOr<size_t> size(StringView path);
bool can_delete_or_move(StringView path);