FACTOID # 163: Only 4% of married women in Chad are using contraceptives.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Symbolic link

In computing, a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.[1] Symbolic links first appeared in the 4.2BSD release of Berkeley Unix (1983). They are today supported by the POSIX operating-system standard, most Unix-like operating systems, Windows Vista, and to some degree in Windows 2000 and Windows XP. Not to be confused with symbolic link. ... For the formal concept of computation, see computation. ... This article is about computer files and file systems in general terms. ... A path is the general form of a file or directory name, giving a files name and its unique location in a file system. ... POSIX or Portable Operating System Interface[1] is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API) for software compatible with variants of the Unix operating system. ... Diagram of the relationships between several Unix-like systems A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification. ... An operating system (OS) is a software that manages computer resources and provides programmers with an interface used to access those resources. ... Windows Vista (pronounced ) is a line of operating systems developed by Microsoft for use on personal computers, including home and business desktops, laptops, Tablet PCs, and media centers. ... Windows 2000 (also referred to as Win2K) is a preemptive, interruptible, graphical and business-oriented operating system designed to work with either uniprocessor or symmetric multi-processor computers. ... Windows XP is a line of operating systems developed by Microsoft for use on personal computers, including home and business desktops, notebook computers, and media centers. ...


Symbolic links operate transparently: programs which read or write to files named by a symbolic link will behave as if operating directly on the target file. However, programs that need to handle symbolic links specially (e.g., backup utilities) may identify and manipulate them directly.


A symbolic link merely contains a text string that is interpreted and followed by the operating system as a path to another file or directory. It is a file on its own and can exist independently of its target. If a symbolic link is deleted, its target remains unaffected. If the target is moved, renamed or deleted, any symbolic link that used to point to it continues to exist but now points to a non-existing file. Symbolic links pointing to non-existing files are sometimes called orphaned.

Contents

Unix

To create a symbolic link in Unix, at the shell prompt, enter the following command:

 ln -s target_filename symlink_filename 

Replace target_filename with the relative or absolute path which the symlink will point to. Usually the target will exist, although you can create a symlink to a target which does not exist. Replace symlink_filename with the desired name of the symbolic link. The ln command then creates the symbolic link. After you've made the symbolic link, you can then treat symlink_filename as an alias for the target file. You can use normal file management commands (e.g., cp, rm) on the symbolic link. Commands which read or write the file contents will access the contents of the target file.

 user@userbox:~/one$ cd two user@userbox:~/one/two$ ls a b user@userbox:~/one/two$ cd user@userbox:~$ ln -s ~/one/two three user@userbox:~$ cd three user@userbox:~/three$ ls a b user@userbox:~/three$ cd user@userbox:~$ cat ./one/two/a a
user@userbox:~$ echo "c" > ./one/two/a user@userbox:~$ cat ./three/a c

In Unix, symbolic links are created with the same ln shell command as hard links, but they behave very differently from the latter. Hard links are just (possibly multiple) names associated with a file and cannot exist without their associated file. When one hard link is moved, renamed or deleted, any other hard links referring to the same file data remain unaffected. Only when the last hard link to a file is deleted, the file content disappears. Unlike hard links, symbolic links can also point to directories and cross volumes. The ln command is used on Unix-like systems to create links between files. ... In computing, a hard link is a reference, or pointer, to physical data on a storage volume. ... Introduction and Definition In the context of computer operating systems, volume is the term used to describe a single accessible storage area with a single filesystem, typically (though not necessarily) resident on a single partition of a hard disk. ...


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. Disk storage is a general category of a computer storage mechanisms, in which data is recorded on planar, round and rotating surfaces (disks, discs, or platters). ... A binary tree, a simple type of branching linked data structure. ... In computing, an inode is a data structure on a traditional Unix-style file system such as UFS. An inode stores basic information about a regular file, directory, or other file system object. ... Look up block in Wiktionary, the free dictionary. ... The UNIX file system (UFS) is a file system used by many Unix and Unix-like operating systems. ... A retronym is a type of neologism coined for an old object or concept whose original name has come to be used for something else, is no longer unique, or is otherwise inappropriate or misleading. ...


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. POSIX or Portable Operating System Interface[1] is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API) for software compatible with variants of the Unix operating system. ... 2006 is a common year starting on Sunday of the Gregorian calendar. ...


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. Most modern file systems have methods of administering permissions or access rights to specific users and groups of users. ...


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.


GoboLinux

One Linux distribution, GoboLinux, uses symlinks extensively in an effort to redesign the file system hierarchy. This offers the opportunity to create a more intuitive directory tree and to reorganize without having to redesign the kernel itself. GoboLinux is an alternative Linux distribution. ... For library and office filing systems, see Library classification. ... In computing, a directory, catalog, or folder[1] is an entity in a file system which contains a group of files and/or other directories. ...


Mac OS

Aliases

Main article: Alias (Mac OS)

In addition to the usual Unix symbolic links, Mac OS can employ aliases, which have the added feature of working even if the target file moves to another location on the same disk. A similar functionality also exists in some Linux distributions. In System 7 and later, an alias is a small file that represents another object in the file system. ... This article relates to both the original Classic Mac OS as well as Mac OS X, Apples more recent operating system. ... This article is about operating systems that use the Linux kernel. ...


Windows

NTFS Junction points

Main article: NTFS junction point

The Windows 2000 version of NTFS introduced reparse points, which enabled, among other things, the use of Volume Mount Points and junction points. Junction points are for directories only, and moreover, local directories only; junction points to remote shares are unsupported.[2] The Windows 2000 and XP Resource Kits include a program called linkd to create junction points; a more powerful one named Junction was distributed by Sysinternals' Mark Russinovich. An NTFS junction point (JP) is a feature of the NTFS file system version 3. ... Windows 2000 (also referred to as Win2K) is a preemptive, interruptible, graphical and business-oriented operating system designed to work with either uniprocessor or symmetric multi-processor computers. ... NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, and Windows Vista. ... An NTFS reparse point (JP) is a type of NTFS file system object. ... Volume Mount Points are specialized NTFS filesystem objects which are used to mount and provide an entry point to other partitions. ... An NTFS junction point (JP) is a feature of the NTFS file system version 3. ... Sysinternals (formerly using name Winternals) is a website, operated by developers Bryce Cogswell and Mark Russinovich, that has several freeware tools to administrate and monitor Microsoft Windows computers. ... Mark Russinovich is a software engineer and author who works for Microsoft as a Technical fellow. ...


Windows Vista symbolic link

Main article: NTFS symbolic link

Windows Vista supports symbolic links for both files and directories with the command line utility mklink. Unlike junction points, a symbolic link can also point to a file or remote SMB network path. Additionally, the NTFS symbolic link implementation provides full support for cross-filesystem links. However, the functionality enabling cross-host symbolic links requires that the remote system also support them, which effectively limits their support to Windows Vista and later Windows operating systems. In computing, an NTFS symbolic link (symlink) is a file-system object that points to another file system object. ... Windows Vista (pronounced ) is a line of operating systems developed by Microsoft for use on personal computers, including home and business desktops, laptops, Tablet PCs, and media centers. ... In computer networking, Server Message Block (SMB) operates as an application-level network protocol mainly applied to shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network. ...


Symbolic links are designed to aid in migration and application compatibility with POSIX operating systems -- Microsoft aimed for Vista's symbolic links to "function just like UNIX links"[3]. However, the implementation varies from Unix symlinks in several ways; for example, Vista users must manually indicate when creating a symbolic link whether it is a file or directory,[4] and there is a limit of 31 symlinks in a given path.[5]. Additionally, only users with the new Create Symbolic Link privilege, which only administrators have by default, can create symbolic links;[6] if this is not the desired behavior, it must be changed in the Local Security Policy management console. POSIX or Portable Operating System Interface[1] is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API) for software compatible with variants of the Unix operating system. ...


Shortcuts

Main article: Computer shortcut

Symbolic links resemble shortcuts, which are supported by the graphical file browsers of some operating systems, but differ in a number of important ways. One difference is what type of software is able to follow them: Computer shortcuts are small files containing only the location of another file, and sometimes specific parameters to be passed to it when run. ... Computer shortcuts are small files containing only the location of another file, and sometimes specific parameters to be passed to it when run. ...

  • References to symbolic links are resolved by the file system in the operating-system kernel, and therefore any application software that knows nothing about symbolic links will follow them automatically.
  • Application shortcuts are treated by the filesystem in the operating-system kernel and by applications that know nothing about them like ordinary files, and only applications that know about them (usually special file browsers) treat them as references to other files.

Another difference are the capabilities of the mechanism:

  • Microsoft Windows shortcuts can only refer to a destination by an absolute path (starting from the root directory), whereas POSIX symbolic links can refer to destinations via either an absolute or a relative path. The latter is useful if both the location and destination of the symbolic link share a common path prefix, but that prefix is not yet known when the symbolic link is created (e.g., in an archive file that can be unpacked anywhere).
  • Microsoft Windows application shortcuts contain additional metadata that can be associated with the destination, whereas POSIX symbolic links are just strings that will be interpreted as absolute or relative pathnames.

Windows redirects here. ... A path is the general form of a file or directory name, giving a files name and its unique location in a file system. ... In computer file systems, the root directory is the first or top-most directory in a hierarchy. ... A path is the general form of a file or directory name, giving a files name and its unique location in a file system. ... A prefix is the initial portion of some object or term (typically in text or speech) with a distinct and he base semantics for a word. ... A file archiver combines a number of files together into one archive file, or a series of archive files, for easier transportation or storage. ...

Cygwin symlinks

Cygwin uses method to simulate POSIX-compliant symbolic links. Using command:

 ln -s target_filename symlink_filename 

creates Windows shortcut (.lnk file) with additional information used by Cygwin ad the time of symlinks execution. Doing so makes Cygwin symlinks compliant both with Windows and POSIX standard.


The difference is that in Windows such symlink is treated like regular shortcut (which in fact it is) so it causes different behaviour when such file/directory is used from Cygwin or Windows command line.


Another problem is that Cygwin while creating its own symlink has now way to specify shortcut-related information - such as working directory or icon - as there is no place for such parameters in ln -s command. To create standard Microsoft .lnk files Cygwin provides mkshortcut utility[7]


For more information please check Cygwin User's Guide[8]


Others

Symbolic links also resemble shadows in the graphical Workplace Shell of the OS/2 operating system. In the graphical Workplace Shell of the OS/2 operating system, a shadow is an object that represents another object. ... The OS/2 Warp 4 desktop (with some third-party enhancements installed as SOM classes) The Workplace Shell (WPS) is an award-winning object-oriented desktop shell produced by IBMs Boca Raton development lab for OS/2 2. ... OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. ...


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. In computing, an operating system (OS) is the system software responsible for the direct control and management of hardware and basic system operations. ... Domain/OS was the operating system used by the Apollo/Domain line of workstations manufactured by Apollo Computers, Inc. ... DragonFly BSD is a free Unix-like operating system created as a fork of FreeBSD 4. ...


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

In computing, a hard link is a reference, or pointer, to physical data on a storage volume. ... The ln command is used on Unix-like systems to create links between files. ... A symlink race is a kind of software security vulnerability that results from a program creating files in an insecure manner. ...

External links

References

  1. ^ Pathname resolution, POSIX.
  2. ^ Sysinternals Junction documentation
  3. ^ Symbolic Links, MSDN Library, Win32 and COM Development, 2008-01-18
  4. ^ CreateSymbolicLink Function, MSDN Library, Win32 and COM Development
  5. ^ Symbolic Link Programming Considerations, MSDN
  6. ^ Mark Russinovich: Inside the Windows Vista Kernel: Part 1 – File-based symbolic links, Microsoft Technet, February 2007.
  7. ^ [1] Microsoft .lnk files in Cygwin
  8. ^ [2] Cygwin User's Guide, Cygwin.
Wikibooks
Wikibooks has a book on the topic of

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL. POSIX or Portable Operating System Interface[1] is the collective name of a family of related standards specified by the IEEE to define the application programming interface (API) for software compatible with variants of the Unix operating system. ... Cygwin (pronounced ) is a collection of free software tools originally developed by Cygnus Solutions to allow various versions of Microsoft Windows to act similar to a Unix system. ... Image File history File links Wikibooks-logo-en. ... Wikibooks logo Wikibooks, previously called Wikimedia Free Textbook Project and Wikimedia-Textbooks, is a wiki for the creation of books. ... This article does not cite any references or sources. ... “GFDL” redirects here. ...


  Results from FactBites:
 
Using symbolic links (1637 words)
To create a symbolic link, the new system call symlink(2) is used and the owner must have write permission in the directory where the link will reside.
When the rm(1) command is executed and the argument is a symbolic link, it is the symbolic link that is removed; the referenced file is not touched.
When a user accesses the symbolic link abc, it is the file permissions (ownership and access) of file def that are actually used; the permissions of abc are always ignored.
IBM: BFS Link Processing (550 words)
The symbolic link is a type of soft link; it is a pointer to another file system object, either in the same or a different BFS file space.
A MEL is similar to a symbolic link; it is a pointer to another directory in the same or a different BFS file space, including the root of a different BFS file space.
But unlike a symbolic link, when a MEL is encountered as a pathname component during BFS pathname lookup, a mount is simulated at that point.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.