Kinds of links in Linux and use of unlink
Hello, I am learning about file types in Linux, and i see there are hard and symbolic links, also I saw that unlink function in C deletes a link to a file and decrements the intern link counter. The problem is that i don't understand what link is deleted when unlink is called. Is it the parents link to that file?
|
A normal file has one hard link, a directory entry which points to the inode for the file. The inode keeps track of the number of hard links. When you unlink the last one, the file is gone. The link removed by unlink is the one that is passed to it when it is called.
|
Thank you very much. This made things clear.
|
All times are GMT -5. The time now is 03:25 AM. |