bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ln overwrites newly created files


From: Eric Blake
Subject: ln overwrites newly created files
Date: Tue, 21 Aug 2007 14:53:49 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Contrast the following:

$ mkdir a b c
$ echo 1 > a/f
$ echo 2 > b/f
$ cp -v a/f b/f c --remove-destination
`a/f' -> `c/f'
cp: will not overwrite just-created `c/f' with `b/f'

with the similar:

$ rm c/f
$ ln -vf a/f b/f c
`c/f' => `a/f'
`c/f' => `b/f'
$ cat c/f
2

Oops - we overwrote the just-created c/f with a link to b/f.  Similarly
with ln -s, where we lose the just-created link to a/f.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGy1Dd84KuGfSFAYARAtiRAJ9fJq8E/+VwDD7RtvtddyvB8SxeogCgp4jl
4XHUCBCtF56kPXjG+3vG8c4=
=TWFp
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]