comp.lang.ada
 help / color / mirror / Atom feed
From: Markus E L <development-2006-8ecbb5cc8aREMOVETHIS@ANDTHATm-e-leypold.de>
Subject: Re: Ada.Directories
Date: Sun, 21 Oct 2007 17:29:26 +0200
Date: 2007-10-21T17:29:26+02:00	[thread overview]
Message-ID: <ug6410v63t.fsf@hod.lan.m-e-leypold.de> (raw)
In-Reply-To: 411h1vmet9dh$.uij5asq361ds$.dlg@40tude.net


"Dmitry A. Kazakov" wrote:

> On Sun, 21 Oct 2007 15:05:57 +0200, Jacob Sparre Andersen wrote:
>
>> Dmitry A. Kazakov wrote:
>> 
>>> "." is not a hard/soft link,
>> 
>> On a Unix system it _is_ a hard link.
>
> AFAIK, no, because you cannot unlink it:

Well, no Dmitry. It _is_ - as Jacob said - a hard link. One that
cannot be removed. Look at the link count for directories and learn
something. Why do you think it is 2+N where N is the number of
subdirectories in the directory? Think about ".." and ".".

Even when "." and ".." are not implemented as actual hard links in the
directory structure (like in AFAIR JFS) the FS code takes any effort
to maintain the illusion that there are hard links. This is part of
the interface contract (AFAIK even described in various standards).

> Finally, as it should be from the very beginning! (:-))
>
> [When links are reference counted, as IMO it is in Unix, then you obviously
> cannot introduce cycles without ruining the file system.]

Certainly. That is why hardlinking directories is forbidden for the
users.

Please don't start on of your discussions on definitions now. For once
I have noticed earlier that your Unix know-how is somehow a bit
lacking and on the other side you can go against what's written in
literature (just look at a number of books on OS design and
implementation) if you like, but that will be hardly convincing.

Regards -- Markus

PS: Another thing for you to think about:

    tmp/:$ ls -id t
    130716 t
    tmp/:$ ls -id t/.
    130716 t/.
    
    tmp/:$ ls -id t/u
    130718 t/u
    tmp/:$ ls -id t/u/.
    130718 t/u/.
    tmp/:$ ls -id t/u/..
    130716 t/u/..

    Hm. See a pattern (the number is the inode number, see ls(1))?





  reply	other threads:[~2007-10-21 15:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-20  9:21 Ada.Directories Dmitry A. Kazakov
2007-10-20 18:43 ` Ada.Directories anon
2007-10-20 19:40   ` Ada.Directories Dmitry A. Kazakov
2007-10-20 20:35     ` Ada.Directories Maciej Sobczak
2007-10-21  7:40       ` Ada.Directories Dmitry A. Kazakov
2007-10-21 13:05         ` Ada.Directories Jacob Sparre Andersen
2007-10-21 13:26           ` Ada.Directories Dmitry A. Kazakov
2007-10-21 15:29             ` Markus E L [this message]
2007-10-21 15:38             ` Ada.Directories Jacob Sparre Andersen
2007-10-21 17:19             ` Ada.Directories Martin Krischik
2007-10-21 18:52               ` Ada.Directories Dmitry A. Kazakov
2007-10-21 20:32                 ` Ada.Directories Markus E L
2007-10-21 23:52         ` Ada.Directories Robert A Duff
2007-10-22 11:08         ` Ada.Directories Harald Korneliussen
2007-11-15 11:44           ` Ada.Directories Markus E L
2007-11-16 13:27             ` Ada.Directories Dmitry A. Kazakov
2007-11-16 16:48               ` Ada.Directories Martin Krischik
2007-11-16 18:47                 ` Ada.Directories Larry Kilgallen
2007-11-16 20:35                   ` Ada.Directories Martin Krischik
2007-11-16 19:00                 ` Ada.Directories Dmitry A. Kazakov
2007-10-21  1:25     ` Ada.Directories anon
2007-10-20 22:36   ` Ada.Directories Larry Kilgallen
2007-10-22 18:56 ` Ada.Directories Adam Beneschan
2007-10-23  9:04   ` Ada.Directories Peter Hermann
2007-10-23 12:07     ` Ada.Directories Larry Kilgallen
2007-10-23 13:01       ` Ada.Directories Peter Hermann
2007-10-23 16:08       ` Ada.Directories Robert A Duff
2007-10-23 17:11         ` Ada.Directories Larry Kilgallen
2007-10-24  0:55   ` Ada.Directories Brian May
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox