against file which has hard link to another file

You actually only have one file on disk (uniquely identified by the device and inode values, see stat and lstat) with, in effect, two references to it in the directory table. You can have multiple hard links all pointing to the same file if you like. Any change to one will appear in all of them. However, deleting one of them will leave the others in place.

$ echo "hello world" > xxyyzz $ ln xxyyzz aabbcc $ ln xxyyzz ddeeff $ ls -li aabbcc ddeeff xxyyzz 45063 -rw-r--r-- 3 root root 12 Aug 7 23:36 aabbc +c 45063 -rw-r--r-- 3 root root 12 Aug 7 23:36 ddeef +f 45063 -rw-r--r-- 3 root root 12 Aug 7 23:36 xxyyz +z $ cat aabbcc hello world $ echo bye >> ddeeff $ cat xxyyzz hello world bye $ rm aabbcc $ ls -li aabbcc ddeeff xxyyzz aabbcc: No such file or directory 45063 -rw-r--r-- 2 root root 16 Aug 7 23:38 ddeef +f 45063 -rw-r--r-- 2 root root 16 Aug 7 23:38 xxyyz +z $

I hope this helps you.

Cheers,

JohnGG


In reply to Re: file input output problem by johngg
in thread file input output problem by convenientstore

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.