From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucio De Re To: 9fans@cse.psu.edu Subject: Re: [9fans] mv vs cp Message-ID: <20011008062832.V28720@cackle.proxima.alt.za> References: <20011007162401.77DEE1998A@mail.cse.psu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20011007162401.77DEE1998A@mail.cse.psu.edu>; from jmk@plan9.bell-labs.com on Sun, Oct 07, 2001 at 12:23:59PM -0400 Date: Mon, 8 Oct 2001 06:28:32 +0200 Topicbox-Message-UUID: fffd3e2e-eac9-11e9-9e20-41e7f4b1d025 On Sun, Oct 07, 2001 at 12:23:59PM -0400, jmk@plan9.bell-labs.com wrote: > > As Dave points out, there are a lot of balls in the air during > an atomic 'rename'. 4.2BSD introduced the 'rename' system call, > and as an alpha/beta tester for 4.1[abc] and 4.2BSD I can testify > to how long it took to get it right and how much ugly code was > involved. > There are really only two social factors overriding here. People like me have grown to expect it, unfortunate as it may be, and the alternative is inconsistent and open to error, besides being much more time and resource intensive. In addition, it may be more consistent for mv not to go part way and do a cp+rm on my behalf _on_condition_ that the request is not recursive, rather not do it at all. But I suppose my MSDOS background shows here, the "mv" I'm thinking of is "REN". That, I ought to be able to fix by crippling "mv". What wasn't clear from Dave's response, is whether we would need a "Tmv" to do it all, including recursive copies that (shudder!) may need to understand the entire namespace, or just "Tren" that may still change the namespace, but at least won't have to make decisions on how to follow mounted resources. I should imagine that BSD "rename" must have been made orders of magnitude more complex by symbolic links. After all, SysV 3.2 "mv" could rename directories into other directories in the same filesystem, couldn't it? It's been a long time since my 3B2 was turned off, so it's hard for me to check. I'm almost certain SCO Xenix and Unix could do it without copying. ++L