Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Aug 1998 11:33:24 -0700 (PDT)
From:      David Wolfskill <dhw@whistle.com>
To:        freebsd-questions@FreeBSD.ORG, gary@tein.net, romank@graphnet.com
Subject:   Re: Simple UNIX question
Message-ID:  <199808051833.LAA18242@pau-amma.whistle.com>
In-Reply-To: <35C8916C.B87B5809@graphnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>Date: Wed, 05 Aug 1998 13:07:56 -0400
>From: Roman Katsnelson <romank@graphnet.com>

>a hard link will physically copy the file to be linked to to the
>other location....

Either I'm misunderstanding the above, or it's not correct.  Therefore,
in order to try to help prevent misunderstanding:

A "hard" link (originally, the only kind of link) creates another name by
which a file may be known (a pathname).  The new name, as well as any
other names, actually are all equivalent to one another.  (Originally,
they all referred to the same inode; in turn, the inode specified where
the file's data blocks happened to be, as well as the timestamps,
permissions, ownership -- basically, all the neat stuff that stat() will
tell you if you ask it nicely.  This is still essentially the case,
though tere are now lots of different kinds of filesystems, and
directory entries now may refer to inodes or vnodes or....  But the
point is that a "hard" link creates a directory entry, which refers to
the place where the filesystem tracks the attributes of the file, so all
such names are equivalent.)

A "soft" (or "symbolic" -- thus "symlink") link creates a (textual) pointer
to a pathname... which might be a name for a file, or could be another
symlink (but be careful about overdoing that one!).

One of the significant issues between the two is that a "hard" link can
only refer to a file on the same filesystem.  A symlink, however, can
refer to a file on a different filesystem... or even a file on a
different machine (given a suitable environment, such as one that does
arguably interesting things with "amd").

david
-- 
David Wolfskill		UNIX System Administrator
dhw@whistle.com		voice: (650) 577-7158	pager: (650) 371-4621

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808051833.LAA18242>