Lost in LoC


Microsoft Yet Again Confounds Me In Ways I Never Would Have Predicted – A Trajedy in One Part

Posted in Development, Technology by Ryan Baldwin on August 26, 2008
Tags: , , , ,

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….

9 Responses to 'Microsoft Yet Again Confounds Me In Ways I Never Would Have Predicted – A Trajedy in One Part'

Subscribe to comments with RSS or TrackBack to 'Microsoft Yet Again Confounds Me In Ways I Never Would Have Predicted – A Trajedy in One Part'.


  1. This is holdover from the early DOS days. The simple reason it is supported even today is that there is a lot of legacy and existing programs that depend on these device names NUL, CON, COM1, COM2 etc.. Microsoft choose to provide backward compatibility rather than force people to re-write applications.

    I suggest that you read this informative article and its comments to really understand the actual issues involved – http://blogs.msdn.com/oldnewthing/archive/2003/10/22/55388.aspx

  2. ivan said,

    not only con, but com1, com2… lpt1, lpt2 … – device names

  3. Gigixu said,

    You’re pretty young , right ? :)
    That’s like that since the dark ages

  4. Ryan said,

    Unfortunately, people will complain no matter what Microsoft does. What would happen if they took that out and it broke legacy code?

  5. cranley said,

    @Jayakrishnan, I’ll definitely check out that article – I’d like to get some more insight simply from a learning perspective.

    @Gigixu – heh, admittedly I’m young’ish? 29, been developing for 7 years but have worked with computers for about 15. I’ve just never come up against this problem the whole time… kinda caught me off guard.

    @Ryan (the other ryan) – yea, I can understand backwards compatability, and I can understand reserving device names – what I don’t get, however, is why that reservation is a blanket reservation across the entire FS as opposed to, say, simply under a certain directory as it is in *nix (/dev).

    I’ll read jay’s article that he linked. I’m interested.

    Thanks for all the comments guys – mucho appreciated.

  6. tony arkles said,

    On Windows 95/98, you could use this to crash any machine with file sharing turned on.

    From the malicious machine: Start -> Run -> \\victim-machine\con\con

    Bam, BSOD :)

  7. cranley said,

    that, Tony, is astoundingly incredibly sadly awesome.


  8. Why not just use a reserved character to indicate a special file? Like ‘#CON’?


  9. What I mean is, this is bad, even if your excuse is “DOS 1″.


Leave a Reply