[X-Unix] Utility "ln" makes a copy instead of hard link?

Jerry Krinock jerry at ieee.org
Fri Apr 7 16:09:37 PDT 2006

on 06/04/07 10:38, Brian L. Matthews at blmatthews at gmail.com wrote:

> How are you editing 1.txt? Some editors follow this procedure when
> writing a file:
> write the file to a temp file
> delete the original file
> rename the temp file to have the same name as the original file

Ah, yes.  Of course that is Apple's recommended "save save" idiom for GUI
apps to a file, and obviously what TextEdit is doing.
> Also, if you do an ls -l, 1.txt and 2.txt should have a 2 after the
> permissions. That's the number of links to the file. Remove one of
> the two and it will drop to 1, add another hard link, it will
> increase, etc.

Indeed, it does.



More information about the X-Unix mailing list