public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Noack, Sebastian" <S.Noack@AUTOonline.de>
To: <gentoo-user@lists.gentoo.org>
Subject: AW: [gentoo-user] [OT] Why directories aren't files?
Date: Mon, 18 Sep 2006 11:49:38 +0200	[thread overview]
Message-ID: <7B97065F451A23458ED0C63B4CA5A2EA7C4ACC@SRV-EXCHANGE.AUTOonline.local> (raw)

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, unix-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 Linux. 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 special kind of files, you should use Plan9.

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. And when you read 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 of it is a directory, the most clean way IMHO would be to show a corresponding error message.

Best Regards
Sebastian Noack



> -----Ursprüngliche 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?
> 
> 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.
> Bye.
> 
> --
>  * Pillon Matteo
> --
> gentoo-user@gentoo.org mailing list


-- 
gentoo-user@gentoo.org mailing list



             reply	other threads:[~2006-09-18  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-18  9:49 Noack, Sebastian [this message]
2006-09-18 11:50 ` AW: [gentoo-user] [OT] Why directories aren't files? Matteo Pillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7B97065F451A23458ED0C63B4CA5A2EA7C4ACC@SRV-EXCHANGE.AUTOonline.local \
    --to=s.noack@autoonline.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox