1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:27:43 +00:00

LibCore: Use ErrorOr<T> for Core::File::copy_file()

This commit is contained in:
Andreas Kling 2021-11-07 01:42:54 +01:00
parent c7e62d448c
commit 4a2b718ba2
8 changed files with 37 additions and 32 deletions

View file

@ -61,7 +61,7 @@ int main(int argc, char** argv)
if (result.error().tried_recursing)
warnln("cp: -R not specified; omitting directory '{}'", source);
else
warnln("cp: unable to copy '{}' to '{}': {}", source, destination_path, result.error().error_code);
warnln("cp: unable to copy '{}' to '{}': {}", source, destination_path, static_cast<Error const&>(result.error()));
return 1;
}

View file

@ -74,7 +74,7 @@ int main(int argc, char** argv)
Core::File::AddDuplicateFileMarker::No);
if (result.is_error()) {
warnln("mv: could not move '{}': {}", old_path, result.error().error_code);
warnln("mv: could not move '{}': {}", old_path, static_cast<Error const&>(result.error()));
return 1;
}
rc = unlink(old_path);

View file

@ -125,7 +125,7 @@ int main(int argc, char** argv)
Core::File::AddDuplicateFileMarker::No);
if (result.is_error()) {
warnln("usermod: could not move directory {} : {}", target_account.home_directory().characters(), result.error().error_code);
warnln("usermod: could not move directory {} : {}", target_account.home_directory().characters(), static_cast<Error const&>(result.error()));
return 1;
}
rc = unlink(target_account.home_directory().characters());