Hi,

On Mon, 18 Sep 2006 17:13:11 +0200
[EMAIL PROTECTED] wrote:

> > > For example, in Linux, you can't do 'cat .' while on FreeBSD you can.
> > > Why? There is a practical reason?
> >
> Try vim . or, better view .

It was mentioned before that applications have support for "reading
directories". But application level is mostly irrelevant. The kernel
doesn't support reading directories (i.e. there's no implementation for
the "read" syscall for all filesystems currently in the kernel -- if I
didn't miss one). Vim just does an "readdir" syscall after failing to
"read", but that's application logic. I think this thread is meant to
be more general. Since the kernel doesn't support "read" on
directories, it is valid to claim that "linux doesn't". It can,
however: Filesystems _can_ implement read() for directories. They
currently just don't.

Also note that according to "man 2 read" the return of an error EISDIR
is conforming to SVr4, 4.3BSD, POSIX.1-2001. "The Open Group Base
Specifications Issue 6" does at least say that implementations that do
not support read()ing from directories will return this error (and that
applications should use readdir() instead). So Linux is compliant here.
It could behave differently, if filesystem designers would chose to do
so.

-hwh
-- 
gentoo-user@gentoo.org mailing list

Reply via email to