Welcome to the Linux Foundation Forum!

hardlink typo ?

Hello,

it says in section 16 that:
Hard links point to an inode.​ All hard linked files have to be on the same filesystem. Changing the content of a hard linked file in one place may not change it in other places.

I don't think that this is true, when changing a file all the rest hardlinked files change since they point to the same Inode, I just tested it.
did i understand something wrong?

Comments

  • coop
    coop Posts: 835

    it can depend on the application. There are dumb applications that make a copy of the original file then change that copy and rewrite in the same location. Then the link can be broken. Some editors used to do this but at least vi and emacs no longer do.

    May sound weird, but believe me I have seen it and it can be rather destructive and not obvious simultaneously.

Categories

Upcoming Training