On Mon, Sep 18, 2006 at 04:30:52PM +0200, Hans-Werner Hilse wrote: > On Mon, 18 Sep 2006 11:10:57 +0200 Matteo Pillon <[EMAIL PROTECTED]> wrote: > > I was wondering why Linux doesn't treat directories like files, as > > many other unix implementations do. > > Pragmatic answer: > > because nobody implemented it for most filesystems. Most filesystems > just define "generic_read_dir" as handling function for "readdir". > "generic_read_dir" always returns -EISDIR. > > (see /usr/src/linux/fs/libfs.c and /usr/src/linux/fs/*/dir.c) > > > For example, in Linux, you can't do 'cat .' while on FreeBSD you can. > > Why? There is a practical reason? > > Well, I think it would be just another unstable API that clueless > programmers would get trapped by. What would be the benefit of being > able to open it?
Yeah, you're right, it's just funny and I was curious why Linux behaves differently. Thanks for your explanation. > That would be the LKML :-) Ok. -- * Pillon Matteo -- gentoo-user@gentoo.org mailing list