From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,96296bb60aa5db9 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: Ada.Directories References: <1o4hp0vtlenw0.jql7yewhhr4a.dlg@40tude.net> <1192912525.922514.185180@q3g2000prf.googlegroups.com> <411h1vmet9dh$.uij5asq361ds$.dlg@40tude.net> From: Markus E L Date: Sun, 21 Oct 2007 17:29:26 +0200 Message-ID: User-Agent: Some cool user agent (SCUG) Cancel-Lock: sha1:/7szJ+TL2p2lY1kKWCqmKubh158= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 88.72.217.214 X-Trace: news.arcor-ip.de 1192980220 88.72.217.214 (21 Oct 2007 17:23:40 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news2.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.buerger.net!news.f.de.plusline.net!news-fra1.dfn.de!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news2.google.com comp.lang.ada:2547 Date: 2007-10-21T17:29:26+02:00 List-Id: "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))?