..

Way back when when NTFS was first being designed, the designers of the filesystem had a problem - what should they do with "." and "..".  Traditionally, in *nix filesystems (and MS-DOS's FAT filesystem), "." and ".." were two hard links that were created by the mkdir command that included links to the current and parent directory. 

For subdirectories, "." and ".." posed no issues at all - NTFS could do exactly what *nix and FAT did - create links to the parent and current directory and be done with it.

But there was a problem with the root.  You see, *nix just had a "." in the root, HPFS had "." in the root, but FAT didn't have any special characters in the root. 

The NTFS guys decided to treat the root exactly the same as any other directory - the root would have a "." and a "..", both of which linked to the root directory.  That way apps that traversed should behave correctly.

When they rolled this out, I raised some issues about appcompat to the NTFS team, and their answer was "Nah, it shouldn't be a problem, after all, the worst thing that can happen is if they traverse ".." through the root - no big deal.  And it made their design much cleaner - there was nothing special about the root directory, it was just another directory.

 

 

Anyone who's read Raymond's blog knows exactly what happened next :).

 

Yup, the bugs started coming in.  You see, applications that tried to present pretty dialogs for navigation (like the common file dialog) allowed the user to type in ".." into their control (or select the ".." entry).  Because they wanted to be helpful, they would also show the full path to the file, so when you clicked on ".." it removed the last path element from the file (so "C:\Users\LarryO\Pictures" would be displayed as "C:\Users\LarryO" in the title of the dialog box).  Of course, when you clicked on the ".." entry in the root, they immediately crashed because they tried to navigate through "C:" and couldn't find a \ to back up.

 

So the NTFS guys had to rethink their plans for the root directory.  They probably could have gotten away with having just "." in the root and no "..", but the developers decided to be safe - "If FAT doesn't put entries in the root, we won't."  And thus the root directory on NTFS partitions doesn't contain a "." or ".." entry.

 

 

This post written with Windows Live Writer.

Edit: Replaced symlinks with hard links.