Gentoo Archives: gentoo-user

From: alain.didierjean@××××.fr
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Why directories aren't files?
Date: Mon, 18 Sep 2006 15:21:10
Message-Id: 1158592391.450eb78720002@imp6-g19.free.fr
In Reply to: Re: [gentoo-user] [OT] Why directories aren't files? by Hans-Werner Hilse
1 Selon Hans-Werner Hilse <hilse@×××.de>:
2
3 > Hi,
4 >
5 > On Mon, 18 Sep 2006 11:10:57 +0200 Matteo Pillon
6 > <matteo.pillon@×××××.com> wrote:
7 >
8 > > I was wondering why Linux doesn't treat directories like files, as
9 > > many other unix implementations do.
10 >
11 > Pragmatic answer:
12 >
13 > because nobody implemented it for most filesystems. Most filesystems
14 > just define "generic_read_dir" as handling function for "readdir".
15 > "generic_read_dir" always returns -EISDIR.
16 >
17 > (see /usr/src/linux/fs/libfs.c and /usr/src/linux/fs/*/dir.c)
18 >
19 > > For example, in Linux, you can't do 'cat .' while on FreeBSD you can.
20 > > Why? There is a practical reason?
21 >
22 >
23 Try vim . or, better view .
24
25 --
26 ~adj~
27
28
29 --
30 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] [OT] Why directories aren't files? Hans-Werner Hilse <hilse@×××.de>