>A file is basically just a collection of
>inodes, and the file name is tied to the first inode.

just for the sake of squashing misinformation, the statement above is a
false.  i'm sure lots of people caught that, but for record i figured it'd
be a good thing to correct.

traditional unix file systems have 1 inode per file.  inodes contain meta
data, and pointers to data blocks that contain the actual data (and for very
large files, it points to blocks of pointers to blocks) - and for very small
files, the inodes contain actual file data.

btw - wade, try RTFW before posting: http://en.wikipedia.org/wiki/Hard_link

:-p

Josh Coates
www.jcoates.org

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Corey Edwards
Sent: Monday, May 16, 2005 9:25 AM
To: [email protected]
Subject: Re: hard vs. soft links


On Mon, 2005-05-16 at 09:06 -0600, Wade Preston Shearer wrote:
> I have read the man page but am still confused. What is the
> difference between hard and software links. I have tested both and
> it
> doesn't make sense to me. Hard links don't seem to be links at all.

That would be a "soft" link, not a "software" link. They're all software
after all.

Every file starts with an inode. That's the basic building block of
files. They're small, usually 4k or so, and you string together a bunch
of them to make larger files. A file is basically just a collection of
inodes, and the file name is tied to the first inode.

Well, when you create a hard link you just make another file that points
to that first inode. Same data, just a different name. One important
point about hard links is that since an inode is only deleted when all
references to it are removed, adding more hard links prevents the file
from being deleted. All hard links have to be removed before the file is
gone. And since inodes are specific to a filesystem, they can't cross
boundaries, ie. you can't link across mount points.

Soft links are files in and of themselves. The content of the file is
basically the name of the file they point to. The act the opposite of
hard links in regards to deleting and mount points.

One important point to remember is that file permissions are tied to the
inode, not to the file names. Changing permission on a hard link will
change the permission on every hard link to that file. Soft links don't
even bother with permissions but rather push that back to the linked
file. That's why they always show up with "rwxrwxrwx" permissions.

Corey



.===================================.
| This has been a P.L.U.G. mailing. |
|      Don't Fear the Penguin.      |
|  IRC: #utah at irc.freenode.net   |
`==================================='

Reply via email to