forked from nicokoch/reflink
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better error messages when reflinking directories.
On macos, `clonefile` can handle directories (https://www.manpagez.com/man/2/clonefile/, https://opensource.apple.com/source/xnu/xnu-3789.21.4/bsd/man/man2/clonefile.2.auto.html - sorry, i couldn't find any better source online), which is a lot faster than manually walking the directory tree. This currently leads to a confusing error messages when the target directory exists, saying just `the source path is not an existing regular file` and not reporting the real cause, `File exists (os error 17)`. This PR makes two changes: We return the original error for both files and directories, and for the error for irregular src paths, we still display the original error so the information isn't lost.
- Loading branch information
Showing
2 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters