|
In computing, a symbolic link (often shortened to symlink) consists of a special type of file that serves as a reference to another file. Symbolic links often appear in Unix-like operating systems. Unlike a hard link, a symbolic link does not point directly to data, but merely contains a symbolic path which an operating system uses to identify a hard link (or another symbolic link). Thus, when a user removes a symbolic link, the file to which it pointed remains unaffected. (In contrast, the removal of a hard link will result in the removal of the file if that file has no other hard links.) Systems can use symbolic links to refer to files even on other mounted file systems. Software folk may use the term orphan to refer to symbolic link whose target does not exist. Symbolic links operate transparently, which means that their implementation remains invisible to applications. When a program opens, reads, or writes a symbolic link, the operating system will automatically redirect the relevant action to the target of the symlink. However, functions exist to detect symbolic links, so applications may find and manipulate them if needed. Users should pay careful attention to the maintenance of symbolic links. Unlike hard links, if the target of a symbolic link is removed, the data vanishes and all links to it become orphans. Conversely, removing a symbolic link has no effect on its target. The operating system Plan 9, designed as a research successor to Unix, omits symbolic links.
Storage of symbolic links Early implementations of symbolic links would store the symbolic link information in standard disk blocks, much like regular files. The file contained the textual reference to the link's target, and an indicator denoting it as a symbolic link. This arrangement proved somewhat slow, and could waste disk-space on small systems. An innovation called fast symlinks allowed storage of the link-text within the standard data structures used for storing file information on disk (inodes). This space generally serves for storing the chain of disk blocks composing a file (60 bytes on the Unix File System). This simply means that users can reference shorter symbolic links quickly. Systems with fast symlinks often fall back to using the older method if the path and filename stored in symlink exceeds the available space in the inode, or for disk compatibility with other or older versions of the operating system. The original style has become retroactively termed slow symlinks. Although storing the link value inside the inode saves a disk block and a disk read, the operating system still needs to parse the pathname information in the link, which always requires reading an additional inode and generally requires reading other — potentially many — directories, processing both the list of files and the inodes of each of them until it finds a match with the link pathname components. Only when a link points to a file inside the same directory do fast symlinks provide significant gains in performance. The POSIX standard does not require very many struct stat values to have meaning for symlinks. This allows implementations to avoid symlink inodes entirely by storing the symlink data in directories. However, the vast majority of POSIX implementations (including all implementations currently in widespread use) do use symlink inodes.File Permissions on Symbolic Link: The permissions on the symbolic (or soft)link have no relevance, i.e. the permissions set on the file pointed by the symlink controls the access rights. Note too that the size of a symbolic link equates exactly to the number of characters in the path to which it points. Similar concepts For people familiar with the Microsoft Windows operating system, a symbolic link resembles a shortcut. However, Windows does not build links into the filesystem: instead, it uses a standardized shortcut file format ( Microsoft has indicated that Windows will support true symbolic linking as of the release of Windows Vista/Windows Longhorn Server. Another option under Windows, junction points (which require NTFS 3.1 / Windows 2000), resemble symbolic links more closely than do Windows shortcuts. Symbolic links also approximate aliases in the Mac OS operating system, though they do not track movement of the link target. Symbolic links also resemble shadows in the graphical Workplace Shell of the OS/2 operating system. See also | ||||||||
|
| |||||||||
![]() |
|
| |