From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1GPFqR-0006BN-7k for garchives@archives.gentoo.org; Mon, 18 Sep 2006 09:55:19 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.6) with SMTP id k8I9seFl031407; Mon, 18 Sep 2006 09:54:40 GMT Received: from mail.autoonline.de (mail.autoonline.de [195.158.141.68]) by robin.gentoo.org (8.13.8/8.13.6) with ESMTP id k8I9o2En030519 for ; Mon, 18 Sep 2006 09:50:03 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: AW: [gentoo-user] [OT] Why directories aren't files? Date: Mon, 18 Sep 2006 11:49:38 +0200 Message-ID: <7B97065F451A23458ED0C63B4CA5A2EA7C4ACC@SRV-EXCHANGE.AUTOonline.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [gentoo-user] [OT] Why directories aren't files? thread-index: AcbbAsiQljCN9yxIRS6PB+jombCvnQAApecA From: "Noack, Sebastian" To: X-MIME-Autoconverted: from quoted-printable to 8bit by robin.gentoo.org id k8I9o2En030519 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by robin.gentoo.org id k8I9seG1031407 X-Archives-Salt: d5b7d993-d62a-4f0a-a81b-ad5f8fb85700 X-Archives-Hash: a3bf6a56be151d2cea9f4ddedcf3299b Hi, the question is, what is a file? I would say; a file is an object related= to a specific inode. So a directory would be a file as well as FIFOs, un= ix-sockets, char, block-devices, symlinks and of course regular files. The problem is, that not each kind of file is threaded the same way on Li= nux. And also it isn't on FreeBSD and the most unix-like systems. If you = want an OS, where really everything is a file without exceptions and spec= ial kind of files, you should use Plan9. But independent from this aspect, a file refers in its inode to a chunk o= f storage on the hard disk (or other storage medias), which contains its = data. But some files like directories don't contain data. And when you re= ad from a file for example by cat, the content of its allocated chunk of = storage will be read. But if there is no such data, for example because o= f it is a directory, the most clean way IMHO would be to show a correspon= ding error message. Best Regards Sebastian Noack > -----Urspr=FCngliche Nachricht----- > Von: Matteo Pillon [mailto:matteo.pillon@gmail.com] > Gesendet: Montag, 18. September 2006 11:11 > An: gentoo-user@lists.gentoo.org > Betreff: [gentoo-user] [OT] Why directories aren't files? >=20 > Hi all, >=20 > 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? >=20 > Forgive me this OT, I wasn't able to find a suitable list. >=20 > Thanks for replies. > Bye. >=20 > -- > * Pillon Matteo > -- > gentoo-user@gentoo.org mailing list --=20 gentoo-user@gentoo.org mailing list