9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] mv vs cp
@ 2001-10-07  6:29 Lucio De Re
  2001-10-07  6:42 ` Quinn Dunkan
  0 siblings, 1 reply; 5+ messages in thread
From: Lucio De Re @ 2001-10-07  6:29 UTC (permalink / raw)
  To: 9fans mailing list

Am I being utterly obtuse, or does it really make sense to duplicate
then delete files when moving them to another directory?

I had the distribution archives in /dist under "kfs" and decided to do
the following:

	% cd /dist
	% mkdir plan9
	% mv *.9gz plan9

the machine is still busy copying plan9.9gz :-(

In this case, a "rename" would have been appropriate.  Is it not
possible to determine whether it would work and resort to cp+rm if
it doesn't?

In fact, a rename command would be an adequate compromise.  I see
there's a "kfs" command called "rename" but the man page does not
specify its actual scope.  Should I have used that (one file at the
time) instead?

++L


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] mv vs cp
  2001-10-07  6:29 [9fans] mv vs cp Lucio De Re
@ 2001-10-07  6:42 ` Quinn Dunkan
  2001-10-07  9:17   ` Lucio De Re
  0 siblings, 1 reply; 5+ messages in thread
From: Quinn Dunkan @ 2001-10-07  6:42 UTC (permalink / raw)
  To: 9fans


> Am I being utterly obtuse, or does it really make sense to duplicate
> then delete files when moving them to another directory?

mv does try to rename (uses dirwstat, I think), but you can only rename to the
same directory, check mv.c.  There was a discussion a while back about how
hard cross directory renames are.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] mv vs cp
  2001-10-07  6:42 ` Quinn Dunkan
@ 2001-10-07  9:17   ` Lucio De Re
  2001-10-07  9:26     ` Re[2]: " Matt
  0 siblings, 1 reply; 5+ messages in thread
From: Lucio De Re @ 2001-10-07  9:17 UTC (permalink / raw)
  To: 9fans

On Sat, Oct 06, 2001 at 11:42:15PM -0700, Quinn Dunkan wrote:
> 
> mv does try to rename (uses dirwstat, I think), but you can only rename to the
> same directory, check mv.c.  There was a discussion a while back about how
> hard cross directory renames are.

Sorry to be pig-headed about this, but I guess I'm spoilt (Boyd,
none of your sarcasm, please) with NetBSD doing it all for me.

Thing is, I may be representative of a largish community of spoilt
users, but there are also other considerations, for example, there
may not be enough space for the copy, a situation made worse by
the presence of a large time window in which race conditions can
occur.

Russ asks a pertinent question, how does one tell?  I'm wondering,
not being too good at the innards of Plan 9 and/or the filesystem,
whether it would not be worth sacrificing the cleanliness of the
filesystem to the ability to know.  Yes, it is a slippery slope:
once you can tell, why not move directories around, and so forth.

All I can say in self-defence is that user convenience is being
sacrificed here (I ought to know, but I can't remember how the
various Windows flavours deal with the problem) and the sacrifice
may be greater than the gain in simplicity.

I'm sure I'm wrong, but I never quite understood the underlying
limitation, so perhaps I can be pointed in the right direction and
I'll shut up for good.

++L


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[2]: [9fans] mv vs cp
  2001-10-07  9:17   ` Lucio De Re
@ 2001-10-07  9:26     ` Matt
  0 siblings, 0 replies; 5+ messages in thread
From: Matt @ 2001-10-07  9:26 UTC (permalink / raw)
  To: Lucio De Re



LDR> All I can say in self-defence is that user convenience is being
LDR> sacrificed here (I ought to know, but I can't remember how the
LDR> various Windows flavours deal with the problem) and the sacrifice
LDR> may be greater than the gain in simplicity.

win2k doesn't copy the file



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re[2]: [9fans] mv vs cp
  2001-10-11  1:06 okamoto
@ 2001-10-11  8:40 ` Matt
  0 siblings, 0 replies; 5+ messages in thread
From: Matt @ 2001-10-11  8:40 UTC (permalink / raw)
  To: 9fans

>>Before you start saying that shared /tmp or all-mighty root are bad ideas,

ogcouaj> I hate all-mighty root user because s/he can read my mail box.
ogcouaj> Kenji

Don't worry Kenji, I never found anything interesting so stopped
looking at it



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-10-11  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-07  6:29 [9fans] mv vs cp Lucio De Re
2001-10-07  6:42 ` Quinn Dunkan
2001-10-07  9:17   ` Lucio De Re
2001-10-07  9:26     ` Re[2]: " Matt
2001-10-11  1:06 okamoto
2001-10-11  8:40 ` Re[2]: " Matt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).