قالب وردپرس درنا توس
Home / Tips and Tricks / Windows 10 still does not let you use the 1974 reserved file names

Windows 10 still does not let you use the 1974 reserved file names



Windows "reserves" certain filenames and does not let them use them everywhere. Forget about calling a file "con.txt" or "aux.mp3". This is all down to a 1974 decision and Microsoft's thirst for eternal backward compatibility.

File Names You Can not Use

Microsoft provides an official list of reserved file names and here they are:

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, ​​COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9

Note that this is possible Do not use these filenames with a file extension. Therefore, you can not name a file "con.txt", "con.jpg", "or" con.doc. "Windows is case-insensitive, so it does not matter if it's CON, con Windows does not let you use this name.

You can try it for yourself by saving a file as "con.txt" or "lpt6.txt" in Notepad, or name any file in File Explorer in Windows simply does not allow you to do this.

Of course, Windows also restricts file names in other ways, and you can not use a few special characters, such as the following: For more information, see the official Microsoft documentation.

What happened in 1974 and why should we be interested?

As @Foone has recently stated on Twitter, this is Edition back to 1974. Under UNIX, "everything is a file". (Same goes for today's operating systems like Linux.) Hardware devices are represented on special paths like / dev / lp0 for the first printer and / dev / tty for the console.

In 1974, the same concept was added to the CP / M operating system. Unfortunately, CP / M was designed for computers with very little memory and no hard drives. Multiple disks were used, not directories, so these specialized files representing devices appeared virtually everywhere on every disk.

So if you save a text file, you could tell your text editor to save it to the printer, which would print it. But text editors and other programs like adding file extensions like ".txt", so CP / M ignored the file extension for those device files. If a text editor attempts to save a file under the name of the printer, followed by ".txt", CP / M merely assumed that it refers to the printer and ignored the file extension. Now the function worked flawlessly in every application – great!

Sure, it's a dirty hack, but who cares? Well, CP / M has prevailed. Finally, PC-DOS was added and retained the useful CP / M function. PC-DOS 2.0 added directories in 1983, but Microsoft chose to display these device files in all directories for compatibility with existing DOS software instead of placing them in a special device folder.

Finally came Windows 95 and so on was built on DOS. Windows NT was not based on DOS, but wanted to be backward compatible with Windows 95 applications. Windows 10 is still based on Windows NT and works the same way. The same goes for Windows 7.

Well, it's over forty years later, and we still can not call the files "con.txt" or "aux.mp3" because Windows wants to stay compatible with old programs Use this feature. It's a good example of how committed Microsoft is to backward compatibility.


Source link