Re: Linux's interpretation of trailing '/'

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Tue, 15 Dec 1998 10:31:17 +0000 (GMT)


On Mon, 14 Dec 1998, Jeremy Fitzhardinge wrote:

> A friend of mine pointed out that Linux's interpretation of a trailing
> '/' on ordinary files differs from traditional Unix behaviour.
>
> On Linux:
> $ touch z
> $ cat z/
> cat: z/: Not a directory

> All quite reasonable and logical, but Solaris behaves this way:
>
> : aegis:pts/4; echo foo > z
> : aegis:pts/4; cat z/
> foo

> Now I would say that Linux makes complete sense, and the Solaris
> behaviour looks like sloppy handling to mee. My friend who raised the
> issue points out that its consistent if you regard '/' as a delimiter in
> the same way as whitespace is delimiter in /bin/sh, and consequently you
> should just ignore trailing '/' as you would trailing whitespace on a
> command like.

A trailing / isn't like trailing whitespace - it's like appending '':
weejock@ferret:~$ cat ''
cat: : No such file or directory

Matthew.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/