> Igmar Palsenberg wrote:
> > 
> > >How do hard links and sym links differ?
> > 
> > >Chris
> > 
> > A hard link is just a copy of the file. A softlink is a real link
> 
>  This is not correct.  A hard link is *not* a copy of the file, it
> is a copy of the file header linking to the rest of the file in its
> original location on the disk.
> 
>  If you take a file of size n and make a hard link to it, the
> disk use of the two will be n, not 2n.
> 
>  The disk use of the original file and a symlink will be
> n + <length of path to file>
> 

Although this (last statement) is correct there are more aspects,
which should be mentioned, or expressed in other terms.

A hard link is a directory entry, which refers to the same inode,
as the original file entry. Therefor the link count for this inode
is incremented. This has some consequences: first, you cannot define
a hard link across partitions or drives. Second, when you unlink
one directory entry, the file is not removed, until the link count
is zero. Third, you cannot define a hard link to a directory.

A soft link is another file, with an own inode, that contains the 
name of the file it points to. A symbolic link can point across
partitions, e.g. from a NFS partition to the local disk, but if you
remove the original file, it will get stale and point to nowhere,
since no reference count is used.

Andreas
-- 
The day Microsoft produces something that doesn't suck, is probably the
        day they start making vacuum cleaners.



-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to