Wednesday, July 04, 2007

Filename con

Can you rename any of your file or folder to filename con?
Try the same with filename aux or nul. Try saving this webpage as con.html.

Quick googling will tell that these are the reserved filenames (character devices).
Do you remember using ‘copy con’ command in old DOS world as copy con test.txt?
con is for console and it simply copies ‘console input file’ to test.txt.
so,

copy test.txt con

is equivalent to
type test.txt

Another filename nul behaves like a file which is not.
It’s like a black hole :-) It swallows everything and nothing comes out.

e.g.
dir>nul
type nul

copy con nul
type nul

List of reserved filenames from wiki:

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

Labels:

posted by GNUlihd @ 6:02 AM

0 Comments:

Post a Comment

<< Home