Re: Ada.Directories




"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))?


.



Relevant Pages

  • Re: [SLE] preserving files creation time
    ... I'm not sure if I can provide the answer directly, but a Linux (and Unix) ... create an additional hard link to a file, ctime will change. ... This is a hard link to the current directory. ...
    (SuSE)
  • Re: Hard link
    ... Ok if the date in secret.txt was "My name is Michael" the same data wan in ... Or create a hard link with Unix, ... Dos and ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Deleting files
    ... The reason for the odd name is because on Unix, there's no garantee that ... There' something called a "hard link", ...
    (comp.lang.perl.misc)
  • Re: Deleting files
    ... The reason for the odd name is because on Unix, there's no garantee that ... There' something called a "hard link", ... directory entries, possibly in more than one directory, for the same ...
    (comp.lang.perl.misc)

Loading