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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |