From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 1 Nov 2008 21:12:02 -0500 From: "Eric Van Hensbergen" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: <88AA41FF-421E-4E72-AC4E-FE8CED83D599@sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4C2C9539-5ABB-4230-BC8A-A1765DFC0E1C@utopian.net> <88AA41FF-421E-4E72-AC4E-FE8CED83D599@sun.com> Subject: Re: [9fans] mv on directory Topicbox-Message-UUID: 2c2fcc96-ead4-11e9-9d60-3106f5b1d025 On Sat, Nov 1, 2008 at 4:05 PM, Roman Shaposhnik wrote: > On Nov 1, 2008, at 8:04 AM, Eric Van Hensbergen wrote: >> >> I would imagine that 99% of the time (more?) the behavior people >> desire would be what you describe. > > But what is the behavior? Is it literally the above set of rc commands? > Or is there an atomicity expectation as well? After dircp dirA dirB > the contents of dirB could be surprising, especially given the later > rm -r dirA. > > It seems that mv(1) was taken as far as one could go in terms > of having a non-surprising behavior: mv dir1/file dir2/file is > equivalent to cp -x dir1/file dir2/file ; rm dir1/file. > Well, I suppose there'd have to be a bit more wrapping around checking for failure of the copy before the erase -- but otherwise perhaps I'm being dense and don't see the surprise. Its clear you won't get the atomicity, but there's no clear way to obtain that -- and, as I said, I'm not sure who depends on that when using the mv command. -eric