Why You Can't Name A File CON In Windows

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

In Linux, device files are part of the /dev directory which means they don't need to be banned everywhere. As video guy mentioned Windows can't do this because MS-DOS originally had no directories.

👍︎︎ 28 👤︎︎ u/[deleted] 📅︎︎ Apr 20 2020 đź—«︎ replies

It's interesting that the video frames device files as an antiquated concept when all Unix-like systems still use them as their primary hardware abstraction.

👍︎︎ 64 👤︎︎ u/eypandabear 📅︎︎ Apr 20 2020 đź—«︎ replies

Never touch the ancient source code

👍︎︎ 12 👤︎︎ u/0x3fff0000 📅︎︎ Apr 21 2020 đź—«︎ replies

Just tested it using WSL and it's possible.

👍︎︎ 8 👤︎︎ u/jondySauce 📅︎︎ Apr 20 2020 đź—«︎ replies

C'est con.

👍︎︎ 15 👤︎︎ u/[deleted] 📅︎︎ Apr 20 2020 đź—«︎ replies

TBDW: CON is a reserved name, from the days of MS-DOS, when CON: was used to access the computer console. Other reserved names for DOS devices include AUX, NUL, COM1-COM9, PRN, LPT1-LPT9. For some reason or another, those names are still reserved in Windows.

👍︎︎ 90 👤︎︎ u/frostyoni 📅︎︎ Apr 20 2020 đź—«︎ replies

I clicked because the thumbnail looked like zap brannigan from futurerama

Kif shield this man's Thighs!

👍︎︎ 3 👤︎︎ u/pleasurecabbage 📅︎︎ Apr 21 2020 đź—«︎ replies

This guy’s whole channel is a mealtime video

👍︎︎ 3 👤︎︎ u/[deleted] 📅︎︎ Apr 21 2020 đź—«︎ replies

Dunno if it’s still called, but an older POS system I worked with “printed” to LPT1 to open the till.

👍︎︎ 1 👤︎︎ u/JereTR 📅︎︎ Apr 21 2020 đź—«︎ replies
Captions
Normally, when I film these videos, I’m at the Centre for Computing History in Cambridge. Unfortunately, it is April 2020 as I record this, and times being as they are, I have to make do with a green-screen. But why simulate that same location? I could be anywhere with this, right? Well, first, this would have been a great subject to film at the computer museum. But also: if I change things too much, it’ll break the style, and people don’t like change. Actually, that’s not true: people like just the right combination of novelty and familiarity. On that note: did you know that you can’t name a file “Con” in Windows 10? ...I promise that’s related. If you’re running a Windows machine, try it right now. Go to File Explorer, create a new folder, call it “Con”. C-O-N. 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. "D-i-r". They were called different things back then. Add a redirect symbol, that angle bracket, and instead of the listing going to the screen, it’d be saved to a file. 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. 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. Now, 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 behaviour 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 Mac OS 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. So yes, I couldn’t film this video in the actual Centre for Computing History. But, at least for a while, I don’t have to go to an actual museum to run old applications and games. Catalogues of software and the documents created with them can still be read, even if the exact combination of hardware they were designed for isn’t available. No-one’s expecting your iPhone to read punch cards, but sometimes, a little backwards compatibility can be a good thing.
Info
Channel: Tom Scott
Views: 4,407,502
Rating: 4.9646602 out of 5
Keywords: tom scott, tomscott, the basics, computer science, backwards compatibility, ms-dos, dos, lotus 1-2-3, windows 10
Id: bC6tngl0PTI
Channel Id: undefined
Length: 8min 3sec (483 seconds)
Published: Mon Apr 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.