Thread View: gnu.utils.bug
3 messages
3 total messages
Started by Michael I Bushnell
Fri, 28 Aug 1992 12:57
more thoughts on fileutils
Author: Michael I Bushnell
Date: Fri, 28 Aug 1992 12:57
Date: Fri, 28 Aug 1992 12:57
35 lines
1799 bytes
1799 bytes
There is another, even more important reason for not having the
fileutils be overly clever.
In GNU, nodes can be both directories and ordinary files. (This is a
*possibility* for filesystems; it will not be thus for ufs
filesystems, but it will be thus for other kinds of filesystems in the
initial release.)
The interpretation of such a node is based on context. When it is
used as a directory, it is a directory. When used as a file, it is a
file. Typically, filesystems which permet this are not disk based,
and the contents of the directory tree under such a node is also
present elsewhere on the system. Suppose "foo" is such a node. In
that case "mv bar foo" should delete the existing foo (and the virtual
hierarchy underneath it), replacing it with bar. "mv bar foo/" should
move bar into the directory foo, giving it the name foo/bar, and
leaving the rest of the virtual hierarchy under foo untouched.
To summarize, there are the following possibilities:
Command used-> mv bar foo mv bar foo/
Type of foo
|
v
ordinary file replace foo with bar generate error
just a directory replace foo/bar with bar ditto
both dir and file replace foo with bar replace foo/bar
with bar
Filename completion will need to be wise to this possibility in the
Hurd, and, when it is, the fileutils need to be "unclever".
-mib
more thoughts on fileutils
Author: Richard Stallman
Date: Sun, 30 Aug 1992 20:57
Date: Sun, 30 Aug 1992 20:57
14 lines
1208 bytes
1208 bytes
Suppose "foo" is such a node. In
that case "mv bar foo" should delete the existing foo (and the virtual
hierarchy underneath it), replacing it with bar. "mv bar foo/" should
move bar into the directory foo, giving it the name foo/bar, and
leaving the rest of the virtual hierarchy under foo untouched.
It follows from this that the canonical way to use mv to rename into a
directory named foo must be `mv bar foo/'. `mv bar foo' is something
that may or may not work.
So it is proper that `mv bar foo/' work now on Unix systems. On the
GNU system, this can work by passing `bar/' to the kernel unmodified.
But if on other systems that is not true, then on those other systems
mv needs to compensate by deleting the /.
Re: more thoughts on fileutils
Author: david carlton
Date: Mon, 31 Aug 1992 18:59
Date: Mon, 31 Aug 1992 18:59
21 lines
1454 bytes
1454 bytes
In article <9208282057.AA12744@wookumz.gnu.ai.mit.edu>, mib@gnu.ai.mit.edu (Michael I Bushnell) writes:
> In GNU, nodes can be both directories and ordinary files.
...
> Suppose "foo" is such a node. In that case "mv bar foo" should
> delete the existing foo (and the virtual hierarchy underneath it),
> replacing it with bar. "mv bar foo/" should move bar into the
> directory foo, giving it the name foo/bar, and leaving the rest of
> the virtual hierarchy under foo untouched.
This sounds really bad to me. If foo is going to act like a
directory, it should act like a directory, and one of the qualities of
acting like a directory is that "mv bar foo" renames "bar" to
"foo/bar". If you do things any other way, then all sorts of typing
idioms that people have are no longer going to work, shell scripts and
programs are going to break, and so forth.
david carlton
carlton@husc.harvard.edu
Go on, EMOTE! I was RAISED on thought balloons!!
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads