-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
cp --parents should require the target to be a directory:
$ mkdir ja.utf-8
$ ln -s ja.utf-8/ ja
$ gnucp --reflink -dp --parents ja x
gnucp: with --parents, the destination must be a directory
Try 'gnucp --help' for more information.
But it doesn't:
$ cp --reflink -dp --parents ja x
$ ls -lh x
lrwxrwxrwx 1 jak jak 9 Jul 11 07:04 x@ -> ja.utf-8/
Oh no.
Instead it even fails if the parent directory exists:
$ rm -r x
$ mkdir x
$ cp --reflink -dp --parents ja x
cp: cannot create symlink 'x' to 'ja.utf-8': File exists (os error 17)
Expected behavior:
$ gnucp --reflink -dp --parents ja x
$ ls x
ja@
This all seems to work if the source is not a symlink.