Microsoft Yet Again Confounds Me In Ways I Never Would Have Predicted – A Trajedy in One Part
I know this will come as a surprise to some of you, but Microsoft Windows really is a terrible operating system. A joke. A bad car accident. The underage kid that’s getting drunk for the first time at a yuck-a-flucks party and is vomiting uncontrollably in the back corner of the hosts basement where the mess won’t be found for a few days. I discovered the most obscure, nonsensical bug in Windows XP today (for the record I’m running SP3). I’d be very curious to know if this bug exists in Vista – please chime in if you know.
What I Tried to Do
I’m in the middle of writing an application that’s heavily file based. As part of this application I have an archive of definition files that can be updated by the user whenever they want. When the application starts up it checks for a new and improved version of the archive and decompresses it. We’re not talking rocket science here… pretty straight forward and simple, hey? I thought so too… until my Unit Test was inexplicably failing… repeatedly… for hours.
I debugged and debugged… I read and I read… what the heck is wrong? The error made zero sense:
System.ArgumentException: FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of “\\.\” in the path.
Sure, the message makes sense, but the context doesn’t, because I was passing an absolute path to an area deep inside the bowels of my local file system… not on a fileshare or UNC’d uri. No sir, mine was starting at the good ol’ c:\ and all was fine.
More debugging. More reading. More frustration. Less hair. Lots of tears.
A Revelation!
And then my good friend Janak showed me… THIS! Well well well, it just so happens that the file I was attempting to decompress was named “con.xsd”. Apparently that violates Windows’… err… guidelines/internal-workings/stupid-programmer-hack-fix.
Now, I can understand that perhaps “con” is a reserved filename for keyboard input… i can understand that Windows needs to reserve it… but does it need to reserve that name across an entire file system that spans hundreds of gigs? Am I the only one that thinks that it’s absolutely ridiculous to have blanket protection like that? It’s crazy! Compare it to, oh, I don’t know… POSIX’s guidelines for device files.
Microsoft – get your crap together and stop puking all over Peter’s new bath towels. Yeesh….