From owner-freebsd-stable Tue Oct 9 8:23:48 2001 Delivered-To: freebsd-stable@freebsd.org Received: from mailout02.sul.t-online.de (mailout02.sul.t-online.com [194.25.134.17]) by hub.freebsd.org (Postfix) with ESMTP id 4AC7637B408 for ; Tue, 9 Oct 2001 08:23:44 -0700 (PDT) Received: from fwd06.sul.t-online.de by mailout02.sul.t-online.de with smtp id 15qyjN-0002q4-0B; Tue, 09 Oct 2001 17:23:41 +0200 Received: from pc5.abc (520067998749-0001@[62.155.142.10]) by fmrl06.sul.t-online.com with esmtp id 15qyif-06eCJMC; Tue, 9 Oct 2001 17:22:57 +0200 Received: (from nicolas@localhost) by pc5.abc (8.11.3/8.11.3) id f99FKrJ46560 for freebsd-stable@FreeBSD.ORG; Tue, 9 Oct 2001 17:20:53 +0200 (CEST) (envelope-from list@rachinsky.de) X-Authentication-Warning: pc5.abc: nicolas set sender to list@rachinsky.de using -f Date: Tue, 9 Oct 2001 17:20:52 +0200 From: Nicolas Rachinsky To: freebsd-stable@FreeBSD.ORG Subject: Re: cp -i -R Message-ID: <20011009172052.A37340@pc5.abc> Mail-Followup-To: freebsd-stable@FreeBSD.ORG References: <20011009161204.A22196@pc5.abc> <3.0.5.32.20011009095525.031a30f0@mail.sage-american.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3.0.5.32.20011009095525.031a30f0@mail.sage-american.com> User-Agent: Mutt/1.3.22.1i X-Sender: 520067998749-0001@t-dialin.net Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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