Thursday February 9, 2012 @ 06:16:15 GMT+10    ( Weather:  n/a )
Home » Weblog Archives

Powered byD's Bloggie
Weblog » Archive » 2005 » October » Day 25 » Reserved folder name in Win and Unix
Browse by specific entry ...
 CAPTCHAWhich one ? HTML or XHTML ? 

Reserved folder name in Win and Unix - 12:54 pm
Computing , Security , Weird Stuff  -  poster 

Below is a list of reserved names that cannot be used for folder or file name, either in windows or unix-like file system:

CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

For example, if you try to create a new folder named, "CON" (case-insensitive), windows will "undo" the renaming to the original one. So creating a new folder with the name "CON" just renames it to "New Folder". Try it yourself if you don't believe.

Explanation

This actually is a unix-like feature. DOS device drivers are accessible like normal files, i.e. the everything-is-a-file philosophy. CON is the equivalent of /dev/tty, NUL of /dev/null, COM# of /dev/ttyS#, LPT# of /dev/lp# and CLOCK$ corresponds to /dev/rtc (PRN is an alias to LPT1, AUX is COM1). Every character device can be opened this way, block devices (which are assumed to be FAT formatted...) are named A: to Z:, as you will know. Many pseudo character devices (drivers which had to be loaded as drivers but were no character devices, like EMM386, HIMEM.SYS, ..) had forbidden characters like '*' in their device names to be hidden from the user.

The only problem is: DOS 1, which introduced CON, NUL, PRN and AUX had no directories, i.e. no /dev/, so for compatibility with old DOS1-executables (which don't know that they live in a directory) the character devices have to exist in every directory. Don't know why this feature was not limited to FCB (CP/M like) file access, unix like file numbers were introduced together with directories in DOS 2

Trick

You can however rename/create folders with those reserved names by using the mkdir and ren command in DOS-prompt.
 CAPTCHAWhich one ? HTML or XHTML ? 

Reader comments ( Add your comments )

- No comments (yet) -

Leave a public comment

Info Note: Neither BBCode nor HTML tags are supported currently.
Why ? Just to make my life easier and keep things simple.
Others: Comments that are longer than 1000 characters will be truncated.

    ) Info

Info

Info


Before you submit... verification

Please enter verification codes as seen in the image above to post your comment.
If you can't read the word, click here
(Your comment will be manually approved by admin before it's displayed to public)

$ view_blog.php 2009.09.17 18:16:41 $
Lost? | XML/HTML sitemap | Contact
38.107.179.243 , 22 queries , 0.2701s
Gzip enabled , CSS compressed , JS compressed
Copyright © 2005-2011 Darren's Outpost