From owner-freebsd-questions Fri Jan 12 12:19:56 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9346237B401 for ; Fri, 12 Jan 2001 12:19:37 -0800 (PST) Received: from relay3.inwind.it (relay3.inwind.it [212.141.53.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 255B86E3283 for ; Fri, 12 Jan 2001 12:19:37 -0800 (PST) Received: from bartequi.ottodomain.org (62.98.153.172) by relay3.inwind.it (5.1.056) id 3A40BF8600499B58; Fri, 12 Jan 2001 20:53:32 +0100 From: Salvo Bartolotta Date: Fri, 12 Jan 2001 19:55:53 GMT Message-ID: <20010112.19555300@bartequi.ottodomain.org> Subject: Re: mv /a/b/c/ .. Bug? To: christoph.sold@server.i-clue.de Cc: freebsd-questions@FreeBSD.ORG References: <3A5F40FB.BA91E66A@i-clue.de> X-Mailer: SuperCalifragilis X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 1/12/01, 6:38:03 PM, Christoph Sold=20 wrote regarding mv /a/b/c/ .. Bug?: > Hi Folks, > I just did something unwise: > # mv /a/b/c/ .. > Now the c directory is gone completely. Can anybody explain why and how? Out of curiosity, I have tried such an operation in... /a/b/c/, where I had created a very small text file; the move is performed; /a is an ordinary filesystem. I have also tried from other (ordinary) paths, just to see if there is some hidden bug, but I can't find it :-) On a related note, mv(1) says:
As the rename(2) call does not work across file systems, mv uses cp(1) and rm(1) to accomplish the move. The effect is equivalent to: rm -f destination_path && \ cp -pRP source_file destination && \ rm -rf source_file
Is there really **complete** equivalence ? If I consider issuing 'mv /a/b/c/ ..' from /a/b/c/ itself (which I actually did, see above), then /a/b/c/ should be removed (!), and the operation should fail... I seem to understand there is a mechanism which prevents this kind of scr**** ahem error. Maybe the man page should be slightly modified ? Should I file a PR ? :-) Best regards, Salvo To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message