On Thursday 08 July 2010 22:48:16 Sean Dague wrote: > On 07/08/2010 10:15 PM, Adam wrote: > > I understand the difference between hard links and symlinks, but don't > > (yet) see where anyone would want to use a hard link instead of a > > symlink. In what situations would a hard link be better or more > > appropriate? Thanks in advance for any clarification on this! > > symlinks reference things by name, hard links are baked into the > filesystem. If you rename a file that has inbound symlinks, all those > links break and are now useless. If you rename a file that has multiple > hardlinks, you've only changed the name on one of those instance, all > the links will continue to work as your expect. > > -Sean
Right. The way I keep this in mind is that hard links point to the same INODE on a particular filesystem, whereas softlinks instead point to a particular path and filename. The contents of an inode are deleted when the last link pointing to it is removed, and only hard links actually point to inodes. Thus, every file that exists on a filesystem must have at least one hard link. -- Chris -- Chris Knadle [email protected] _______________________________________________ Mid-Hudson Valley Linux Users Group http://mhvlug.org http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug Upcoming Meetings (6pm - 8pm) MHVLS Auditorium Aug 4 - Samba Sep 1 - BOINC Oct 6 - Creating Firefox Extensions
