Free Web Hosting | free host | Free Web Space | BlueHost Review

WST 21 - NTFS Hard Links
Home Up Interests Downloads (New) My Resume Links Feedback

 

Interests
Downloads (New)
My Resume
Links
WST
Feedback

Hi all,

You may be remembering that we discussed NTFS streams some time back. Streams are a very useful feature provided only by NTFS. Today, we will look at another very useful NTFS feature , this is called a "Hard Link".

You must have worked with file shortcuts thousands of times. The shortcut is a small .lnk file which points to some actual file present somewhere else. A few drawbacks of a short cut are that they are not capable of detecting the changes in their target. That means they can't know if the target file they are pointing to, is present or not after some time. The shortcuts also take unnecessary space if you create many shortcuts to same file.

Hard Links solve all of these problems. A hard link is an alias for a file name. So let's say you have a file at some location (path) on your NTFS drive. Now if you copy it to some other location on the same hard drive, you will have another copy of the same file. However, if you create a hard link to that file, the hard link will make sure that you have only one copy of the file on the disk (saving disk space), and will also keep track of any changes to the target file (modified, moved etc.).

Windows provides only one function for working with Hard Links, CreateHardLink(). You can look at details of this function in MSDN.

Exercises:

1. Study about Hard Links in MSDN and how they are managed by the FS.

2. Study the CreateHardLink() function.

3. Create some hard links and observe different effects on it such as file deletion, file move, modification etc.

I was short on time this week, so that's all for now. We will cover some other topic next week.

Thanks for your time,

-Farooque

 

 

HyperCounter
Bpath Counter