pavement

Unlink

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
 
((polishing))
 
Line 1: Line 1:
This command do exactly the same as [[rm]] : it removes files. If you have read the section about [[links]] you know that one file contents can be read and write throw one or more files thant's to hard links. So the [[unlink]] command is the exact oposite of the [[ln]] command : it removes one link, and if to more links are available for the file contents, it can not be acceeded and will be overwritten by other information.
+
This command does exactly the same thing as [[rm]] : it removes files. If you have read the section about [[links]] you know that one file's contents can be read and write through one or more directory entries thanks to hard links. So the [[unlink]] command is the exact oposite of the [[ln]] command : it removes one link, and if no more links are available for the file contents, it will effectively disappear from the filesystem, and its contents will eventually be overwritten as other data is written to the filesystem.
  
 
The number of hard links for a file can displayed by the [[ls]] command.
 
The number of hard links for a file can displayed by the [[ls]] command.
  
Note that the C programming language primitive for deleting files is :
+
Note that the C programming language primitive for deleting files is : unlink()
unlink()
+
 
 +
[[Category:System Commands]]

Latest revision as of 05:23, 12 July 2005

This command does exactly the same thing as rm : it removes files. If you have read the section about links you know that one file's contents can be read and write through one or more directory entries thanks to hard links. So the unlink command is the exact oposite of the ln command : it removes one link, and if no more links are available for the file contents, it will effectively disappear from the filesystem, and its contents will eventually be overwritten as other data is written to the filesystem.

The number of hard links for a file can displayed by the ls command.

Note that the C programming language primitive for deleting files is : unlink()

Personal tools