Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2001 17:20:52 +0200
From:      Nicolas Rachinsky <list@rachinsky.de>
To:        freebsd-stable@FreeBSD.ORG
Subject:   Re: cp -i -R
Message-ID:  <20011009172052.A37340@pc5.abc>
In-Reply-To: <3.0.5.32.20011009095525.031a30f0@mail.sage-american.com>
References:  <20011009161204.A22196@pc5.abc> <3.0.5.32.20011009095525.031a30f0@mail.sage-american.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 09, 2001 at 09:55:25AM -0500, jacks@sage-american.com wrote:
> Nicolas: I believe "target" is meant to be replaced with the REAL name you
> want to use... if I understood this right....

I'm sorry, I think, my example was a bit unclear. target is a
directory named "target".

I attach a more complete example, see below.
 
> At 04:12 PM 10.9.2001 +0200, Nicolas Rachinsky wrote:
> >I'm wondering if /bin/cp is working as documented.
> >cp -i -R src target
> >is overwriting a regular file named target/src 
> >WITHOUT any warning, if src is a symlink.
> >
> >I think, this behaviour does not match the documentation.
> >
> >Either cp or the docu should be changed.
> >
> >Nicolas


Script started on Tue Oct  9 17:07:19 2001
nicolas@pc5 ~> cd test
nicolas@pc5 ~/test> mkdir target
nicolas@pc5 ~/test> cp /kernel target
nicolas@pc5 ~/test> ln -s nonexistent kernel

#now I have an "important" file ./target/kernel
#and an useless link ./kernel

nicolas@pc5 ~/test> cp -R -i kernel target
nicolas@pc5 ~/test> cd target
nicolas@pc5 ~/test/target> ls -l
total 0
lrwxr-xr-x  1 nicolas  users  11 Oct  9 17:08 kernel@ -> nonexistent
nicolas@pc5 ~/test/target> exit

Script done on Tue Oct  9 17:08:27 2001

I think the second cp should ask, if to overwrite ./target/kernel,
or not.

I took a look in the source and it seems to ignore -i for every action
except copying to a regular file, but I'm not sure, how to correct it.

Nicolas

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011009172052.A37340>