The presence of the dot and double dot in MS-DOS and Windows

165 viewsOtherTechnology

In my quest to understand inodes and why they are, I am got that it was a Unix thing and that the . and .. links are some artifacts of it. In using an old 386 PC with MS-DOS 6.22, I also find these (hard?) links where the file system is FAT16, so why are these present? Of course they are useful but I am asking about why they were brought to FAT16 from whatever file system Unix was using?

In: Technology

3 Answers

Anonymous 0 Comments

As someone who grew up through the various DOS/UNIX versions I may have a useful insight to this. An often used allegory for a file system is an old-fashioned filing cabinet, where files are stored in folders, these are arranged in drawers and so on. The filesystem provides a way to find a particular piece of information from the mass of data stored by putting a structure between the user and the raw data on the disk. This structure allows the user to refine their search for a piece of information using folder and file names.

What has been abstracted from the user through the advent of Windows and other graphical user interfaces, is that each user session maintains a current position in the filesystem. In MSDOS, you would use the CD (change directory) command to move to the folder an executable was in, and then type the name of the executable to run it. The OS would use your current position in the filesystem to determine where to look for the executable. I have spent countless hours troubleshooting .BAT and Shell files for failing to start in the proper folder or similar.

The “.” and “..” files allows the OS to orientate itself. Wherever it currently is in the filesystem, those two files will allow it to find any files in the current directory and connect back up the filesystem tree. Every time a command is typed, it can respond in the same way – open current “.” file, look for executable file, or open current “‘..” file and look at the parent folder. They become shorthand for “in the current folder” and “in the parent folder”.

In summary they are there because they serve a useful purpose, and one that most OS design still needs – a neutral reference point to use when looking for information.

You are viewing 1 out of 3 answers, click here to view all answers.