I'm running OS X Leopard 10.5.4 on an Intel iMac.
In my user directory I create a text file called firstTextFile and list the directory's contents
imac:~ me$ ls -l ~/
-rw-r--r--@ 1 me staff 354 11 Sep 20:26 firstTextFile.rtf
then I create a hard link to this firstTextFile
imac:~ me$ ln /Users/me/firstTextFile.rtf secondTextFile.rtf
then list directory contents
imac:~ me$ ls -l ~/
-rw-r--r--@ 2 me staff 354 11 Sep 20:26 firstTextFile.rtf
-rw-r--r--@ 2 me staff 354 11 Sep 20:26 secondTextFile.rtf
the 2 indicates they are hard linked (pointers) to the same data
now I modify firstTextFile and save it
then list directory contents
imac:~ me$ ls -l ~/
-rw-r--r--@ 1 me staff 363 11 Sep 20:31 firstTextFile.rtf
-rw-r--r--@ 1 me staff 354 11 Sep 20:26 secondTextFile.rtf
now the two files are unlinked separate files. I always thought if I open a hard link and modify it when I open the other hard links they also would be modified as all these hard links point to the same data. Anyone know what's going on?
In my user directory I create a text file called firstTextFile and list the directory's contents
imac:~ me$ ls -l ~/
-rw-r--r--@ 1 me staff 354 11 Sep 20:26 firstTextFile.rtf
then I create a hard link to this firstTextFile
imac:~ me$ ln /Users/me/firstTextFile.rtf secondTextFile.rtf
then list directory contents
imac:~ me$ ls -l ~/
-rw-r--r--@ 2 me staff 354 11 Sep 20:26 firstTextFile.rtf
-rw-r--r--@ 2 me staff 354 11 Sep 20:26 secondTextFile.rtf
the 2 indicates they are hard linked (pointers) to the same data
now I modify firstTextFile and save it
then list directory contents
imac:~ me$ ls -l ~/
-rw-r--r--@ 1 me staff 363 11 Sep 20:31 firstTextFile.rtf
-rw-r--r--@ 1 me staff 354 11 Sep 20:26 secondTextFile.rtf
now the two files are unlinked separate files. I always thought if I open a hard link and modify it when I open the other hard links they also would be modified as all these hard links point to the same data. Anyone know what's going on?