When a recursive copy meets a non-directory where it needs a directory, the error differs from GNU (uutils at 5f3aa7b, GNU 9.12 built from source):
| setup |
command |
GNU |
uutils |
dst is a file |
cp -r src dst |
cannot overwrite non-directory 'dst' with directory 'src' |
cannot overwrite non-directory with directory |
src/sub is a directory, d/sub a file |
cp -r src/. d |
cannot overwrite non-directory 'd/./sub' with directory 'src/./sub' |
cannot create regular file 'd/sub/x': Not a directory |
Both fail and leave the file untouched; only the message differs. uutils drops the names in the first case and reports a later step in the second.
When a recursive copy meets a non-directory where it needs a directory, the error differs from GNU (uutils at 5f3aa7b, GNU 9.12 built from source):
dstis a filecp -r src dstcannot overwrite non-directory 'dst' with directory 'src'cannot overwrite non-directory with directorysrc/subis a directory,d/suba filecp -r src/. dcannot overwrite non-directory 'd/./sub' with directory 'src/./sub'cannot create regular file 'd/sub/x': Not a directoryBoth fail and leave the file untouched; only the message differs. uutils drops the names in the first case and reports a later step in the second.