[comp.bugs.4bsd] another unix joke

gwyn@smoke.ARPA (Doug Gwyn ) (09/14/88)

More UNIX jokes, from 4.3BSD:

$ mkdir foo/
mkdir: foo/: No such file or directory
$ mkdir foo
$ rmdir foo/
rmdir: foo/: Is a directory

bostic@ucbvax.BERKELEY.EDU (Keith Bostic) (09/15/88)

In article <8488@smoke.ARPA>, gwyn@smoke.ARPA (Doug Gwyn ) writes:
> More UNIX jokes, from 4.3BSD:
> 
> $ mkdir foo/
> mkdir: foo/: No such file or directory
> $ mkdir foo
> $ rmdir foo/
> rmdir: foo/: Is a directory

Though I'm not sure what you're trying say, the behavior you're
objecting to is correct.  As the NULL pathname is, by convention,
the equivalent of ".", "foo/" is the same as "foo/.". Creating
or removing "foo/." is illegal.  While it is arguable that the
returned error should be different, or perhaps explicitly documented,
4BSD is doing the right thing.  As POSIX 1003.1 does not support
the equivalence of the NULL path and ".", the problem will die a
natural death.

Keith Bostic

ben@bosco.UUCP (ben ullrich) (09/15/88)

In article <26090@ucbvax.BERKELEY.EDU> bostic@ucbvax.BERKELEY.EDU (Keith Bostic) writes:
]In article <8488@smoke.ARPA>, gwyn@smoke.ARPA (Doug Gwyn ) writes:
]> More UNIX jokes, from 4.3BSD:
]> 
]> $ mkdir foo/
]> mkdir: foo/: No such file or directory
]> $ mkdir foo
]> $ rmdir foo/
]> rmdir: foo/: Is a directory
]
]Though I'm not sure what you're trying say, the behavior you're
]objecting to is correct.  As the NULL pathname is, by convention,
]the equivalent of ".", "foo/" is the same as "foo/.". Creating
]or removing "foo/." is illegal.  While it is arguable that the
]returned error should be different, or perhaps explicitly documented,
]4BSD is doing the right thing.  As POSIX 1003.1 does not support
]the equivalence of the NULL path and ".", the problem will die a
]natural death.

yeesh! it was only a amusing sort of anomaly; lighten up!
no one is ``objecting'' or purporting any ``arguable'' behavior!


...ben
--
ben ullrich				<something silly re: disclaimer>
sybase, inc.
emeryville, ca		{pyramid,pacbell,sun.com,mtxinu,capmkt}!sybase!ben

gwyn@smoke.ARPA (Doug Gwyn ) (09/15/88)

In article <26090@ucbvax.BERKELEY.EDU> bostic@ucbvax.BERKELEY.EDU (Keith Bostic) writes:
>> mkdir: foo/: No such file or directory
>> rmdir: foo/: Is a directory
>Though I'm not sure what you're trying say, ...

I just thought it was amusing that the "reasons" given for failure
of the operations were what they were.  Can't create a directory
because it doesn't exist yet; can't remove a directory because it
is a directory.

dhesi@bsu-cs.UUCP (Rahul Dhesi) (09/15/88)

I like the fact that 4.3BSD treats names like "xyz/" correctly.  Under
System V Release 2, if you give a command like

     mv junk xyz/

your obvious intent is to move the file "junk" into the directory
"xyz".  But if the directory "xyz" does not exist, then "junk" just
gets renamed to "xyz".  The joke is on the user.

Under 4.3BSD if you type "mv junk xyz/" and the directory "xyz" does
not exist you get an error message.

For obvious reasons, I added comp.bugs.sys5 to the newsgroups list.
-- 
Rahul Dhesi         UUCP:  <backbones>!{iuvax,pur-ee,uunet}!bsu-cs!dhesi