Thursday, April 2, 2009

Yet Another Windoze Peculiarity

While working for this summer, I ended up with a bunch of files on my Windows partition of basically every 3-letter combination possible. I just now tried deleting these files, discovering that it can't delete four of them: 'aux', 'con', 'nul', and 'prn'. Deleting nul or prn gives the error: "Cannot delete nul: The parameter is incorrect." Deleting con gives: "Cannot delete con: Cannot find the specified file." Trying to delete aux freezes up explorer.

As soon as I saw nul, I got really suspicious. I created a new folder on my desktop and tried creating empty files of each of those names, but none of them worked; they were just reverted to the name they had before. Turns out the Wikipedia article on Filename lists these reserved words on Windows that cannot be used as filenames: "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."

Further research indicates that you cannot rename, move, or open files of these names within Windows. That would make for an awesome April Fool's Day prank for someone with a Linux livecd...dang, I wish I had thought of this just a little bit sooner!

No comments: