Flickr Badge

Friday, May 26, 2006

NTFS Junction

One of my gripes with Windows XP has been the lack of proper symlinks. They have shortcuts, but a shortcut is not a symlink. Try this:
  1. Create a shortcut to C:\WINDOWS and place the shortcut in C:\
  2. Rename the shortcut to "mytemp"
  3. Open the command prompt by doing Start->Run..->cmd and type cd C:\mytemp
If try that, you will find that you cant access the directory. This is because a shortcut doesn't create a link exactly, but creates a file mytemp.lnk. Now try cd C:\mytemp.lnk, and it will find the file, but since it is only an ordinary file, you can't do a change directory to it. In other words, a shortcut is nothing but a file which has special meaning only to Windows Explorer.

Well, it turns out that NTFS does support actual proper symlinks. These are called Junctions in NTFS. Junctions also allow you to mount filesystems at a mount point much like how it is done in UNIX. The only problem is that there is no way to create Junctions with Windows XP. That was until I found this awesome utility which allows you to create proper junctions on your NTFS drive. This is something that I have been wanting for ages. If you ever wanted proper symlinks on windows, you just have to check out Junction .

No comments: