

By using a hardlink, you can change the original file’s contents or location and the hardlink will still point to the original file because its inode is still pointing to that file. You can also only hardlink files and not directories. Speaking of hard links….Ī hard link is a direct reference to a file via its inode. Should a file be moved from one folder to another, the file will be moved to a different location on the hard drive and its inode value will change with it automatically. With an inode, the OS can retrieve information about the file such as permission privileges and the physical location of the data on the hard drive to access the file.
#SYMLINKER NOT WORKING LOGIC FULL#
They are essentially the numerical equivalent of a full address.

The inode is a database that describes the file/directory attributes such as metadata and the physical location on the hard drive. In order to understand how symbolic and hard links work, we will need to go over what are inodes. Symbolic links on the other hand refer directly to the file which refers to the inode, a shortcut. A hard link is essentially a synced carbon copy of a file that refers directly to the inode of a file. These methods are part of the filesystem that organizes what file is what and where.

Hard links and symbolic links are two different methods to refer to a file in the hard drive. Visualized path difference between hard link and symbolic link references
