Hi (again),

cp -al won't overwrite existing files with hardlinks to the source version. Quoth the online info(1) page for cp in coreutils (the bit about --force):
Contrast this behavior with that enabled by --link and --symbolic- link, whereby the destination file is never opened but rather is unlinked unconditionally.

But this doesn't seem to be the case unless I use --force:
laptop:~/cptest zak$ rm -rf *
laptop:~/cptest zak$ mkdir src dest
laptop:~/cptest zak$ touch src/a dest/a
laptop:~/cptest zak$ ls -i src/a dest/a
524454 dest/a   524453 src/a
laptop:~/cptest zak$ ~/coreutils/coreutils-6.6/src/cp -al src/a dest/a
/Users/zak/coreutils/coreutils-6.6/src/cp: cannot create link `dest/ a': File exists
laptop:~/cptest zak$ ls -i src/a dest/a
524454 dest/a   524453 src/a
laptop:~/cptest zak$ ~/coreutils/coreutils-6.6/src/cp -al --force src/a dest/a
laptop:~/cptest zak$ ls -i src/a dest/a
524453 dest/a   524453 src/a

I'd like cp to behave like the info page says. Is this a bug in cp or the docs?

Cheers,

Zak


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to