Hi, 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? > Forgive me this OT, I wasn't able to find a suitable list. That would be the LKML :-) -hwh -- gentoo-user@gentoo.org mailing list