[NTLUG:Discuss] symbolic links

Darin W. Smith darin_ext at darinsmith.net
Wed Apr 16 10:58:06 CDT 2003


On Wed, 16 Apr 2003 10:43:24 -0500, Fred James <fredjame at concentric.net> 
wrote:


> My understanding of links - please correct me were I may stray - and a 
> question, please:
> (1) When creating a link, no new file is created.
> (a) "hardlinkname" is only an alias for the same inode as the original 
> file.
> (b) "symboliclinkname" (sometimes called "soft link") points to the 
> original inode, and has its own inode.
> (c) The "space savings" of a hard link is that it has no inode of its 
> own.
> (2) Soft links can remain after the original file is deleted, and 
> therefore point to nothing
> (b) Can hard links do the same?
> Thanks in advance.
>


Basically correct, although you could count an inode as a "file" and thus, 
a symbolic link is a "file."  It depends on how strictly you view "files" 
vs. "inodes."  Sorry for the Clintonian argument...

The answer to 2b is no.  As someone else pointed out, hard links can be 
removed one at a time without deleting the file until the last one is 
deleted.  So if a hard link exists, then so does an inode which represents 
the thing originally linked to.  This is one reason that symbolic links 
exist.  You cannot (for example) make hard links across filesystems, 
because if the thing linked to is on another filesystem, your filesystem 
can't keep track of the inode.  So symbolic links were implemented to allow 
something like that, but that also means that you can have "stale" or 
"dangling" symlinks.

-- 
D!
Darin W. Smith
AIM: JediGrover




More information about the Discuss mailing list