Hard link not works under MacOS in GUI mode

Posted by AntonAL on Super User See other posts from Super User or by AntonAL
Published on 2010-05-09T15:30:08Z Indexed on 2010/05/09 22:00 UTC
Read the original article Hit count: 318

Filed under:
|
|

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 its contents are the same as of the 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... What is going on here ?

© Super User or respective owner

Hard link not works under MacOS in GUI mode

Posted by AntonAL on Stack Overflow See other posts from Stack Overflow or by AntonAL
Published on 2010-05-09T15:30:08Z Indexed on 2010/05/09 15:38 UTC
Read the original article Hit count: 318

Filed under:
|
|

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 ?

© Stack Overflow or respective owner

Related posts about macos

Related posts about hardlink