Hard link not works under MacOS in GUI mode
- by AntonAL
Hi, i faced a little strange behavior, while using hard links.
From terminal, i create a text file 1.txt and a hard link "to this file"
nano 1.txt
mkdir dir
ln 1.txt ./dir/
I check the resulting hard link and see, that it's contents is the same, as of "original" file.
less ./dir/1.txt
I change the initial file ...
nano 1.txt
... and see, that changes was reflected in hard-link
less ./dir/1.txt
I change content of hard-link (more correct, of course - file, being referenced with hard-link) ...
nano ./dir/1.txt
... and see, that changes are reflected in initial file
less 1.txt
Until now, all going well...
Now, I close terminal and start playing with created files (1.txt and ./dir/1.txt) from Finder.
When i change on this two files with TextEdit, changes are not reflected in another file.
Just like the hard link was teared off...
Whats going on here ?