1 |
Hi, |
2 |
|
3 |
On Mon, 18 Sep 2006 11:10:57 +0200 Matteo Pillon |
4 |
<matteo.pillon@×××××.com> wrote: |
5 |
|
6 |
> I was wondering why Linux doesn't treat directories like files, as |
7 |
> many other unix implementations do. |
8 |
|
9 |
Pragmatic answer: |
10 |
|
11 |
because nobody implemented it for most filesystems. Most filesystems |
12 |
just define "generic_read_dir" as handling function for "readdir". |
13 |
"generic_read_dir" always returns -EISDIR. |
14 |
|
15 |
(see /usr/src/linux/fs/libfs.c and /usr/src/linux/fs/*/dir.c) |
16 |
|
17 |
> For example, in Linux, you can't do 'cat .' while on FreeBSD you can. |
18 |
> Why? There is a practical reason? |
19 |
|
20 |
Well, I think it would be just another unstable API that clueless |
21 |
programmers would get trapped by. What would be the benefit of being |
22 |
able to open it? |
23 |
|
24 |
> Forgive me this OT, I wasn't able to find a suitable list. |
25 |
|
26 |
That would be the LKML :-) |
27 |
|
28 |
-hwh |
29 |
-- |
30 |
gentoo-user@g.o mailing list |