SYMBOLIC LINK

In computing, a 'symbolic link' (often shortened to '''symlink''' and also known as a '''soft link''') consists of a special type of file that serves as a reference to another file or directory. Unix-like operating systems in particular often feature symbolic links.
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. The term ''orphan'' refers to a 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 do exist to detect symbolic links so that applications may find and manipulate them.
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.

Contents
Storage of symbolic links
Similar concepts
Variant symlinks
Trivia
See also
References
External 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 to store 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.
The file-system permissions on the symbolic (or soft) link have no relevance: the permissions set on the file to which the symlink points control the access rights.
The size of a slow symlink exactly equals the number of characters in the path it points to. The size of a fast symlink is 0.

Similar concepts


In addition to the symbolic link described above, Mac OS can employ aliases, which have the added feature of working even if the target file moves to another location on a different disk.
Microsoft Windows Vista supports symbolic links for both files and directories with the command line utility mklink by what is called an NTFS junction point. Earlier versions of Microsoft Windows do not support symbolic links on files, but do offer directory symlink support. Junction, written by Mark Russinovich of SysInternals, is a free command line utility for creating directory symbolic links on NTFS 5 filesystems. Contrary to popular belief, symbolic links are not application shortcuts, which are supported by most operating systems.
Symbolic links also resemble shadows in the graphical Workplace Shell of the OS/2 operating system.
Variant symlinks

A 'variant symlink' is a symbolic link that has a variable name embedded in it. This can allow some clever tricks to be performed that are not possible with a standard symlink. Variables embedded in the symlinks can include user and or environment specific information among other things.
Operating systems that make use of variant symlinks include Domain/OS and DragonFly BSD.

Trivia


The operating system Plan 9, designed as a research successor to Unix, does not support symbolic links.

See also



Hard link

ln (Unix), the ln command, used with the -s option to create new symbolic links on Unix-like systems

Symlink race, a security-vulnerability caused by symbolic links

NTFS junction point, a similar functionality for folders on newer NTFS filesystems

References




External Links



Links in Windows Vista

Inside the Windows Vista Kernel

This article provided by Wikipedia. To edit the contents of this article, click here for original source.

psst.. try this: add to faves