🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #716

more thoughts on fileutils

#716
From: Michael I Bushnell
Date: Wed, 02 Sep 1992 09:17
38 lines
2475 bytes
   In article <9208282057.AA12744@wookumz.gnu.ai.mit.edu>, mib@gnu.ai.mit.edu (Michael I Bushnell) writes:

   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.

It depends on one's model of the universe.  rename ("bar", "foo") is
*never* the same as rename ("bar", "foo/bar").  Take a look at the man
page for the system call, and you will see that (in Unix) if the
second argument to rename exists, and is a directory, then it must be
an empty directory and the first argument must be a directory.  In
the Hurd, these rules are dependent on the details of the filesystem.
The basic idea is to prevent single system calls from obliterating
entire directory trees.  

The mv shell program never issues rename system calls of this sort.
Instead, it interprets second arguments which are directories in a
peculiar fashion, which we all know and love.

Deciding what mv should do when the system call's semantics have
changed is something that can be addressed on this list.  There will
generally be two kinds of combination directory/files in the Hurd.
The first is typified by transparent tar, in which the file is a tar
archive and the directory is its contents.  The second is loosely
called a "shadow", in which the directory is the union of some other
directories, and the file is a description of the nature of this
union.

For the first, the directory semantics are incidental, and should not
be relevant to the behavior of mv.  It was such a directory I had in
mind when I said that "mv bar foo" and "mv bar foo/" should have
different results.  For the second, the file semantics are incidental,
and the directory rules should apply.  

	-mib
Technical Details
Message-ID: <9209021717.AA14828@geech.gnu.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!mib
References: <01GO8HLZW29SATKOYN@HUSC3.HARVARD.EDU>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!mib
From: mib@gnu.ai.mit.edu (Michael I Bushnell)
Subject: more thoughts on fileutils
Message-ID: <9209021717.AA14828@geech.gnu.ai.mit.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: <01GO8HLZW29SATKOYN@HUSC3.HARVARD.EDU>
Distribution: gnu
Date: Wed, 2 Sep 1992 09:17:29 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 39