Create Hard Links in Windows
This spring I took a course in Operating Systems. Towards the end of the course we studied file systems and learned about link files in Unix. Creating a link makes it look like you have two copies of a file but what you really have is one physical copy of a file and two references to that file (the original reference when you first created the file, known by the user as newFileName, and the second reference created with the command:
ln existingFile newFileName.
The instructor commented that the closest you could get to this under Microsoft Windows was to create a Windows Shortcut (aka .lnk file). The problem with a Windows Shortcut is that if the orginal file is moved to another directory the shortcut no longer works because it is based on the location of a file as given by a directory path, such as C:\Windows\file.txt, instead of how the file system itself internally tracks the file and the filename reference.
Well, since the Windows NT 4.0 days I’ve heard about the sophistication of the Windows NTFS file system - the journaling, security, and how it took a while for the Linux community to figure out how to safely read and later, write to this complex file system. With all that sophistication, I found it hard to believe that the ability to create links was left out; a feature that has been available in Unix since when? Well, it turns out you can create links under Windows, even XP Home Edition* using this the built-in command:
fsutil hardlink create newFileName existingFile
Have fun.
* Assuming your disk is NTFS formatted - which is the default for PCs that ship with XP - and not FAT32 formatted, the default for Windows 98/ME.
No Comments
No comments yet.
RSS feed for comments on this post. TrackBack URI
Sorry, the comment form is closed at this time.



