[gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Matteo Pillon
Hi all, I was wondering why Linux doesn't treat directories like files, as many other unix implementations do. For example, in Linux, you can't do 'cat .' while on FreeBSD you can. Why? There is a practical reason? Forgive me this OT, I wasn't able to find a suitable list. Thanks for replies.

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Roman Zilka
I was wondering why Linux doesn't treat directories like files, as many other unix implementations do. For example, in Linux, you can't do 'cat .' while on FreeBSD you can. Why? There is a practical reason? I'd say it's not a matter of how Linux treats directories (putting aside the problem

AW: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Noack, Sebastian
IMHO would be to show a corresponding error message. Best Regards Sebastian Noack -Ursprüngliche Nachricht- Von: Matteo Pillon [mailto:[EMAIL PROTECTED] Gesendet: Montag, 18. September 2006 11:11 An: gentoo-user@lists.gentoo.org Betreff: [gentoo-user] [OT] Why directories aren't

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Dirk Heinrichs
Am Montag, 18. September 2006 11:10 schrieb ext Matteo Pillon: I was wondering why Linux doesn't treat directories like files, as many other unix implementations do. It's not Linux, but the applications. For example, in Linux, you can't do 'cat .' while on FreeBSD you can. Why? There is a

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Matteo Pillon
On Mon, Sep 18, 2006 at 11:42:29AM +0200, Roman Zilka wrote: I was wondering why Linux doesn't treat directories like files, as many other unix implementations do. For example, in Linux, you can't do 'cat .' while on FreeBSD you can. Why? There is a practical reason? I'd say it's not a

Re: AW: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Matteo Pillon
Hi, On Mon, Sep 18, 2006 at 11:49:38AM +0200, Noack, Sebastian wrote: But independent from this aspect, a file refers in its inode to a chunk of storage on the hard disk (or other storage medias), which contains its data. But some files like directories don't contain data. A directory IS like

AW: AW: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Noack, Sebastian
. September 2006 13:50 An: gentoo-user@lists.gentoo.org Betreff: Re: AW: [gentoo-user] [OT] Why directories aren't files? Hi, On Mon, Sep 18, 2006 at 11:49:38AM +0200, Noack, Sebastian wrote: But independent from this aspect, a file refers in its inode to a chunk of storage on the hard disk

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Roman Zilka
Hm, this is all pretty weird. I cut'n'pasted and compiled your piece of code and again got the same results under Linux and FreeBSD: no output at all. I don't know if some local FreeBSD admin hacked/patched the kernel source to make its syscalls behave Linux-alike, but it's very unlikely.

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Dirk Heinrichs
Am Montag, 18. September 2006 15:04 schrieb ext Roman Zilka: Hm, this is all pretty weird. I cut'n'pasted and compiled your piece of code and again got the same results under Linux and FreeBSD: no output at all. I don't know if some local FreeBSD admin hacked/patched the kernel source to make

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Roman Zilka
Hm, this is all pretty weird. I cut'n'pasted and compiled your piece of code and again got the same results under Linux and FreeBSD: no output at all. I don't know if some local FreeBSD admin hacked/patched the kernel source to make its syscalls behave Linux-alike, but it's very

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Hans-Werner Hilse
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

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread alain . didierjean
Selon Hans-Werner Hilse [EMAIL PROTECTED]: 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

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Matteo Pillon
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

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Hans-Werner Hilse
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

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Hans-Werner Hilse
Hi, 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. sorry short correction, should read: ... as handling function for read. readdir of course should be implemented for

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Ryan Tandy
Matteo Pillon wrote: For example, in Linux, you can't do 'cat .' while on FreeBSD you can. Why? There is a practical reason? I don't know why, but I do know that you can do 'less .'. -- gentoo-user@gentoo.org mailing list

Re: [gentoo-user] [OT] Why directories aren't files?

2006-09-18 Thread Dirk Heinrichs
Am Montag, 18. September 2006 16:51 schrieb ext Roman Zilka: Hm, this is all pretty weird. I cut'n'pasted and compiled your piece of code and again got the same results under Linux and FreeBSD: no output at all. I don't know if some local FreeBSD admin hacked/patched the kernel source