Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: Symbolic linking vs. Hard linking on BSD Message-ID: <6878@brl-smoke.ARPA> Date: 18 Dec 87 23:36:01 GMT References: <926DBLCU@CUNYVM> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 22 In article <926DBLCU@CUNYVM> DBLCU@CUNYVM.CUNY.EDU writes: >It seems that symbolic linking will allow linking across file systems while >hard linking does not, but I do not understand the process. That's the main operational difference from the user's perspective. (Also, some versions of "ls" flag symbolic links specially.) How it works is simple. A "hard link" is just an entry in a directory file that includes a name and an index into the disk "inode" pool (an inode contains data blocks, user ID, protection mode, etc. associated with the actual data file.) A symbolic link is a small file (itself registered as a hard link in some directory, that indexes a special type of inode) containing the pathname to be followed to reach the referenced data file. The operating system kernel notices when it encounters a symbolic link while opening a file (it does this by seeing that the inode type of the symlink is special), and takes special action by reading the small file to find out where to go next.