Directory Representation and Hard Links

Directory Representation and Hard Links - Directory...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Directory Representation and Hard Links A directory is a file that contains a list of pairs (file name, I-node number) Each pair is also called a hard-link An I-node may appear in multiple directories. The reference count in the I-node keeps track of the number of directories where the I-node appears. When the reference-count reaches 0, the file is removed.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Hard Links In some OSs, the reference count is incremented when the file is open. This prevents the file from being removed while it is in use. Hard Links cannot cross partitions, that is, a directory cannot list an I-node of a different partition. Example. Creating a hard link to a target-file in the current directory ln target-file name-link
Background image of page 2
Soft-Links Directories may also contain Soft-Links. A soft-link is a pair of the form (file name, i-node number-with-file-storing-path) Where path may be an absolute or relative path in this or another partition. Soft-links can point to files in different partitions.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Fall '11 term at Purdue University-West Lafayette.

Page1 / 10

Directory Representation and Hard Links - Directory...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online