9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Josh Wood <josh@utopian.net>
To: 9fans@9fans.net
Subject: Re: [9fans] mv on directory
Date: Sat,  1 Nov 2008 09:30:10 -0700	[thread overview]
Message-ID: <785E9BE8-7F20-418B-9DA3-4BC46A3A98B0@utopian.net> (raw)

> I know that. It's a copy, not move.

Looking at mv.c, I believe anything that's not a rename (ie move
within a directory) is a copy, then a hardremove. Mv(1) says the same
thing.


> I just can't see any reason why to mention anything about any bug. I
> didn't do that.
>
>
I wrote that because of this message:

	http://groups.google.com/group/comp.os.plan9/browse_thread/thread/
cfa65300a62de30f

from which I assumed you were extending the list you began there, and
because I support your bug-list idea generally, but *not* as a list
of places where, as I wrote before, "behavior deviates from the
similarly-named command in lunix." It's just boring.

> mkdir dirB
> dircp dirA dirB
> rm -r dirA

It seems like if you made that an rc(1) script and bound it over /bin/
mv, you'd have the desired behavior. No risk would be introduced to
the system, whether or not anyone (aside from the documentation, that
is) relies on mv(1) having the semantics of a wstat.

Given that even if mv(1) agreed to move a directory into another
directory, it would do so as a copy followed by a remove, I don't
understand what benefit there would be in changing mv. It seems like
you're essentially just calling dircp+rm -r by a different name,
which is so easy to do with name spaces.

All that said, it's not like I've never cursed a directory that
wouldn't mv for me in Plan 9 -- so if someone had an answer for Rob's
question: "What should mv do to a tree that resides on multiple file
servers?", it could be interesting to discuss. I don't think arguing
from rm -r is a good tact, though, because of the differing risk
levels between a failed delete and a failed move. One might afford
convenience in the former, and eschew it in the latter.

-Josh




             reply	other threads:[~2008-11-01 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-01 16:30 Josh Wood [this message]
2008-11-01 21:25 ` Roman Shaposhnik
     [not found] <mailman.1.1225540801.26550.9fans@9fans.net>
2008-11-01 13:48 ` Josh Wood
2008-11-01 14:17   ` Rudolf Sykora
2008-11-01 15:04     ` Eric Van Hensbergen
2008-11-01 21:05       ` Roman Shaposhnik
2008-11-02  2:12         ` Eric Van Hensbergen
2008-11-03  3:02           ` Roman Shaposhnik
  -- strict thread matches above, loose matches on Subject: below --
2008-10-31 20:15 Rudolf Sykora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=785E9BE8-7F20-418B-9DA3-4BC46A3A98B0@utopian.net \
    --to=josh@utopian.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).