Information about Hard Links
In computing, a hard link is a reference, or pointer, to physical data on a storage volume. On most file systems, all named files are hard links. The name associated with the file is simply a label that refers the operating system to the actual data. As such, more than one name can be associated with the same data. Though called by different names, any changes made will affect the actual data, regardless of how the file is called at a later time. Hard links can only refer to data that exists on the same file system.
On Unix-like systems, hard links can be created with the link() system call, or the ln utility.
On Microsoft Windows, hard links can be created only on NTFS volumes, either with fsutil hardlink or mklink.
The process of unlinking disassociates a name from the data on the volume. The data is still accessible as long as at least one link that points to it still exists. When the last link is removed, the space is considered free. A process ambiguously called undeleting allows the recreation of links to data that is no longer associated with a name. However, this process is not available on all systems and is often not reliable.
On Unix, the reference count for a file or directory is returned by the stat() or fstat() system calls in the
If the filename "LINK A.TXT" is opened in an editor, modified and saved, then those changes will be visible even if the filename "LINK B.TXT" is opened for viewing since both filenames point to the same data. The same is true if the file were opened as "LINK B.TXT" - or any other name associated with the data.
Additional links can also be created to the physical data. The user need only specify the name of an existing link; the operating system will resolve the location of the actual data section.
If one of the links is removed (ie, with the UNIX 'rm' command), then the data is still accessible under any other links that remain. If all of the links are removed and no process has the file open, then the space occupied by the data will be considered free, allowing it to be reused in the future for other files. This semantic allows for deleting open files without affecting the process that uses them - an action which is impossible on filesystems with a 1-to-1 relationship between directory entries and data.
..... Click the link for more information.
On Unix-like systems, hard links can be created with the link() system call, or the ln utility.
On Microsoft Windows, hard links can be created only on NTFS volumes, either with fsutil hardlink or mklink.
The process of unlinking disassociates a name from the data on the volume. The data is still accessible as long as at least one link that points to it still exists. When the last link is removed, the space is considered free. A process ambiguously called undeleting allows the recreation of links to data that is no longer associated with a name. However, this process is not available on all systems and is often not reliable.
Link counter
Most file systems that support hard links use reference counting. An integer value is stored with each physical data section. This integer represents the total number of links that have been created to point to the data. When a new link is created, this value is increased by one. When a link is removed, the value is decreased by one. The maintenance of this value assists users in preventing data loss. It is also the simplest way for the file system to track the use of a given area of storage, as zero values indicate free space and nonzero values indicate used space.On Unix, the reference count for a file or directory is returned by the stat() or fstat() system calls in the
st_nlink field of struct stat. In contrast, programming language implementations that use reference counting rarely expose the reference count to the program being executed, since this information is just an implementation detail.
Example
In the figure to the right, there are two hard links named "LINK A.TXT" and "LINK B.TXT". They have both been linked - that is, made to point - to the same physical data.If the filename "LINK A.TXT" is opened in an editor, modified and saved, then those changes will be visible even if the filename "LINK B.TXT" is opened for viewing since both filenames point to the same data. The same is true if the file were opened as "LINK B.TXT" - or any other name associated with the data.
Additional links can also be created to the physical data. The user need only specify the name of an existing link; the operating system will resolve the location of the actual data section.
If one of the links is removed (ie, with the UNIX 'rm' command), then the data is still accessible under any other links that remain. If all of the links are removed and no process has the file open, then the space occupied by the data will be considered free, allowing it to be reused in the future for other files. This semantic allows for deleting open files without affecting the process that uses them - an action which is impossible on filesystems with a 1-to-1 relationship between directory entries and data.
Limitations of hard links
There are some issues with hard links that can sometimes make them unsuitable. First of all, because the link is identical to the thing it points to, it becomes difficult to give a command such as "list all the contents of this directory recursively but ignore any links". Most modern operating systems don't allow hard links on directories to prevent endless recursion. Another drawback of hard links is that they have to be located within the same file system, and most large systems today consist of multiple file systems.See also
- symbolic link
- alias (Mac OS)
- shadow (OS/2)
- ln (Unix)—The ln command, which is used to create new links on Unix-like systems.
External links
- On line manual page of ln
- Creating hard links in Windows XP Professional using fsutil
- Utility to create hard links and symbolic links in Linux & Unix
- dupmerge - Utility to create hard links links in Linux & Unix
computing is synonymous with counting and calculating. Originally, people that performed these functions were known as computers. Today it refers to a science and technology that deals with the computation and the manipulation of symbols.
..... Click the link for more information.
..... Click the link for more information.
file system (often also written as filesystem) is a method for storing and organizing computer files and the data they contain to make it easy to find and access them.
..... Click the link for more information.
..... Click the link for more information.
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.
..... Click the link for more information.
..... Click the link for more information.
In computing, a system call is the mechanism used by an application program to request service from the operating system.
..... Click the link for more information.
Background
In addition to processing data in its own memory space, an application program might want to use data and services provided by the system...... Click the link for more information.
ln is a standard Unix program used to create links (link) to files.
..... Click the link for more information.
Link files
Links allow more than one file to refer to the same file, elsewhere...... Click the link for more information.
Microsoft Windows
Screenshot of Windows Vista Ultimate, the latest version of Microsoft Windows.
Company/developer: Microsoft Corporation
OS family: MS-DOS/9x-based, Windows CE, Windows NT
Source model: Closed source
..... Click the link for more information.
Screenshot of Windows Vista Ultimate, the latest version of Microsoft Windows.
Company/developer: Microsoft Corporation
OS family: MS-DOS/9x-based, Windows CE, Windows NT
Source model: Closed source
..... Click the link for more information.
NTFS
Developer Microsoft
Full name NTFS
Introduced July 1993 (Windows NT 3.1)
Partition identifier 0x07 (MBR)
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (GPT)
Structures
Directory contents B+ tree
File allocation Bitmap/Extents
..... Click the link for more information.
Developer Microsoft
Full name NTFS
Introduced July 1993 (Windows NT 3.1)
Partition identifier 0x07 (MBR)
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (GPT)
Structures
Directory contents B+ tree
File allocation Bitmap/Extents
..... Click the link for more information.
Undeletion is a feature for restoring computer files which have been removed from a file system by file deletion. Deleted data can be recovered on many file systems, but not all file systems provide an undeletion feature.
..... Click the link for more information.
..... Click the link for more information.
In computer science, reference counting is a technique of storing the number of references, pointers, or handles to a resource such as an object or block of memory. It is typically used as a means of deallocating objects which are no longer referenced.
..... Click the link for more information.
..... Click the link for more information.
stat() is a Unix system call that returns useful data about an inode. The semantics of stat() vary between operating systems. With Unix command ls, you can gather information about - mtime: time of last modification (
ls -l),
..... Click the link for more information.
A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. Programming languages, like natural languagess, are defined by syntactic and semantic rules which describe their structure and meaning respectively.
..... Click the link for more information.
..... Click the link for more information.
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.
..... Click the link for more information.
..... Click the link for more information.
In Mac OS System 7 and later, an alias is a small file that represents another object in the file system. It is similar to the Unix symbolic link, but with the added benefit of working even if the target file moves to another location on the same disk.
..... Click the link for more information.
..... Click the link for more information.
In the graphical Workplace Shell of the OS/2 operating system, a shadow is an object that represents another object.
A shadow as a stand-in for any other object on the desktop, such as a document, an application, a folder, a hard disk, a network share or removable medium, or
..... Click the link for more information.
A shadow as a stand-in for any other object on the desktop, such as a document, an application, a folder, a hard disk, a network share or removable medium, or
..... Click the link for more information.
ln is a standard Unix program used to create links (link) to files.
..... Click the link for more information.
Link files
Links allow more than one file to refer to the same file, elsewhere...... Click the link for more information.
This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus
