Why You Can't Name A File CON In Windows

Why You Can't Name A File CON In Windows

Did you know that you can’t name a file “Con” in Windows 10? If you’re running a Windows machine, try it right now. Go to File Explorer, create a new folder, call it “Con”. The system is not going to let you do it. You also can’t name a text file “con.txt” or an image “con.jpg”.

Con is a first name, not a common English one, but it’s a variant of Cornelius, Conrad, Connor, Konstantinos. There are a good few people who go by the name Con. So if you’re trying to save a photo of one of them using their name on Windows, you can’t. In fact, the system won't let you call a file or folder CON, AUX, PRN, LST, COM0 through COM9, LPT0 through LPT9, or NUL. And the reason for that goes back to MS-DOS, one of the old white-text-on-a-black-screen command-lines that were just how computers worked back in the 80s.

Actually, it goes back a bit further than that, because all the versions of DOS were copying the idea from other places, but let’s not go too deep into history. In MS-DOS, Microsoft’s version of DOS, all those little words are the names of “device files”. They were a quick and clever way of letting programs on a computer interface with other stuff: printers, keyboards, basically anything that you can plug in. Rather than every program having to understand how to talk to every possible device, that job was given to a “device driver”. And that device driver… drove the device. So programmers didn’t have to worry about how every single type of printer worked. Instead, they could reuse code that they already had for reading and writing files. They’d just save whatever they wanted to print to the right “device file”; it wouldn’t actually get written to disk, instead the device driver would pick it up from there and do all the heavy lifting. But the programmer didn’t have to care about how any of that worked: as far as they were concerned, they could just save a file and something else would deal with it. And eventually, that meant that if a new printer came out with a new, complicated, shiny feature on it... the manufacturer would bundle a new driver with it. All the old programs would still work, they could just save stuff to the device file, same as they always did, and the driver would deal with the messy real-world stuff.

And if you wanted a really, really basic way of using those device files, you could do it with the command line itself. If you typed in dir, you’d get a listing on screen of whatever files were in the current directory or folder. They were called different things back then. Add a redirect symbol, >, and instead of the listing going to the screen, it’d be saved to a file dir > listing.txt.

But if you tried to save it to a file called LPT1, the system would spot that file name, and instead of going to the hard disk, your listing would be sent to the device driver for the parallel port, the one that was labelled LPT1 on the back of your computer. The place where you probably have a printer plugged in.Why You Can't Name A File CON In Windows

So even knowing nothing about how the parallel port or printer worked, you could just... print. The side effect of that was: those file names were reserved. You could not create a file called LPT1. Or CON, which was short for “console”. If you tried, you’d end up sending stuff to a printer or something instead.

Oh, and the really early versions of MS-DOS actually didn’t have the concept of directories, or folders, as we now call them, everything was just in one big heap of files. When directories were added in, those device file names still had to work everywhere, which meant those file names had to be blocked everywhere too. Same with con.txt, because file extensions were stored differently back then. And there is a direct line from thirty-year-old MS-DOS to Windows 10. Each version has built on the one before. If you know where to look, you can still find the Windows 3.1 file selection box from '92 in Windows 10 today, and Windows 3.1 ran on top of MS-DOS.

There aren’t many Windows 10 PCs out there with parallel ports: but I bet there’s a few somewhere. And Microsoft chooses to support them, because of “backwards compatibility”. Backwards compatibility means that you shouldn’t have to buy a new printer just because you’ve got a new computer. New stuff should also support old stuff, within reason.

The trouble is that different companies have very different definitions of “within reason”. Video gamers are used to the idea of backwards compatibility: sometimes games for older consoles will still work on modern ones. But usually, it doesn’t last too long: you can't play a Playstation 1 game on a Playstation 4. At least, not by putting the disk in and expecting it to work. The internal parts are so different that the designers would have to emulate the old system: write a piece of software that translates between the old game and the new console, changing the command calls on the fly, or even just create an entire virtual Playstation 1 that sits in memory. It can be done. But the economic argument for backwards compatibility in games isn’t great: if you support old games, does that mean people won’t buy as many new ones? Couldn't you just sell them a remastered version instead? And if you want to emulate an earlier system, you'll need to emulate everything. Even the bugs.

To this day, Microsoft Excel thinks that the 29th of February 1900 is a real day. It isn’t. 1900 was not a leap year, turn-of-the-century leap years are only leap years if they’re divisible by 400. But when Excel first came out, in '87, it was competing with a program called Lotus 1-2-3, and that program had a bug where it got that leap year wrong. So Excel copied that bug, for backwards compatibility. And more than three decades later, that’s still the case, it’s in the formal specifications, it still gets that wrong because if Microsoft changes that buggy behavior now, they might silently break some really critical spreadsheet somewhere in the world.

Microsoft has always been the company of Backwards Compatibility. It’s built into almost everything they do, it’s part of the deal of why a lot of companies stick with Windows: they will not need to change their workflow. You can still open a Microsoft Word document from thirty years ago in the current version. There are going to be folks out there, somewhere, who still need to use a very old bit of software or hardware, the sort of thing where the company that made it went bust decades ago, and for that to work, it needs to read from a magical device file called CON. So Microsoft, to this day, doesn’t let you save a file with that name. Because it might break something.

It won’t last forever, of course. At some stage, old systems do become too difficult or expensive to keep supporting. Or maybe there's a direction that the company is trying to push their products in. Mac and Apple users will know that all too well; new versions of macOS often just don’t run old programs. New apps, even simple ones, aren’t allowed on older phones. Headphone jacks get removed.

People like a mixture of novelty and familiarity. If you change nothing, people get bored and move on to something else. If you change everything, people hate it, it breaks their workflow, and they move on to something else. Backwards compatibility, with reason, helps to find that balance.

No-one’s expecting your iPhone to read punch cards, but sometimes, a little backwards compatibility can be a good thing.

Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up