LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Quick Question About Links (https://www.linuxquestions.org/questions/linux-newbie-8/quick-question-about-links-45201/)

gauge73 02-13-2003 09:27 AM

Quick Question About Links
 
I've been looking around trying to find information on links (because it's a pretty basic thing, so I should know). I haven't found any really well-written descriptions, and everything I read left me with this question unanswered:

What is the difference between a symbolic link and a hard link?

From what I've gathered thusfar from brief, poorly-written explinations of the difference a symbolic link is actually a file while a hard link is not. With a symbolic link the OS looks at the file allocation table, then goes to the actual symbolic link file, and then reads the file which points it to the correct destination. On the other hand, with a hard link the OS looks at the FAT and the entry for the hard link does not point to a separate file, it points to the destination directly from the FAT. As in the FAT entry for the destination and the FAT entry for the hard link point to the same place.

Is this accurate? If not, could someone explain it better than the junk I've been sifting through?

rzee 02-13-2003 09:32 AM

i think if you delete a hard link you are also deleting the actual file.

isajera 02-13-2003 10:32 AM

no - i don't think that's it. (i used to have a much better grasp on this, but i think i remember correctly) - a symbolic link is a pretty easy concept - it's just a pointer that redirects any request for a file. but with a symbolic link, there's no guarantee that the file will actually be there. it could be a pointer to nowhere.

a hard link is just like the original link - the o/s keeps track of all the hard links to a file, so that if one gets deleted, the actual file is still there. if a hard link is made to a file, and the original link is deleted. it's just like moving the file.


All times are GMT -5. The time now is 05:15 AM.