jim's blog

Sunday, October 16, 2005

What's wrong with CON ?!

Something new, at least to me. Here goes an email that I just received:

An Indian discovered that nobody can create a folder or file anywhere named as "con" This is something pretty cool and unbelievable At Microsoft the whole Team, including Bill Gates, couldn't answer why this happened Try it out yourself

You read it and know what it says. So why does it happen? Is it YAB (yet another bug)? No. Actually, it is just one of many restrictions on naming a file or folder. The reason "con" cannot be used is that it is a reserved device name which means "console", in DOS, and since Windows uses a DOS-like command processor, it compatibly imposes the same restriction. There is a list of similar reserved names: PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. PRN means "printer", AUX "auxillary device", NUL "nonexistent device", COM1 "first serial port", LPT1 "first parallel port", and so forth. It is also illegal to name a file or folder with one of those reserved names followed by an extension, e.g. "con.txt".

Back to the email. It says that Bill Gates and the whole development team didn't know why "con" couldn't be used as a file/folder name. Come on, haven't you figured that out yet? It might be the case that Gates and the team were all too busy to explain that simple naming restriction. Or, you know, when something circulates around in a medium like email, it tends to get spiced up.

21 Comments:

Post a Comment

<< Home