The cause of the error displayed on Windows 10 was in the OS of 1974


On Windows terminals used at the time of 2018, such as Windows 10 and Windows 8, if you try to name the file "AUX" or "CON", the error "The specified device name is invalid" is displayed I will. The cause of this error is described in the OS developed in 1974, explaining the foone which delivers hardware related information.


Thread by @Foone: "It is 2018 and this error message is a mistake from 1974. This limitation, which is still found in the very latest Windows 10, dates back to [...]"
https://threadreaderapp.com/thread/1058676834940776450.html



UNIX is based on the idea of ​​digital research founder Gary Kildore , "Everything is a file", which means that both data on the disk and running processes, Hardware is also expressed as "file". And basically it is possible to execute various processes "from the command line".

This idea was also used for the OS " CP / M " developed in 1974. However, since CP / M was a floppy-based OS designed for 8-bit computers, it did not have the concept of "directory" that is commonly used in modern times. In order to do tasks, we did not specify the directory, but because we took the action of physically changing the floppy.

Because there is no directory, CP / M can not access device special file with "/ dev / directory". In order to solve this problem, CP / M said that special file was placed in "every place". In order to print the file "FOO.TXT", it was necessary to use " PIP LST: = FOO.TXT" to copy foo.txt to the LST (printer) file.

However, since the program tries to produce a file name with the correct extension, when I instruct the LST to print, the text program tries to add the extension ". TXT". Although it is not possible to print with the file "LST.TXT" usually, CP / M said that special file was "enabled for all extensions". As a result, "CON.TXT", "CON.WAT" and "CON.BUG" with "CON" meaning the keyboard also now work.

Between the 1970s and the 1980s, CP / M, widely used in business applications, was selected as one of the OSs on IBM PCs announced by IBM in 1981. However, CP / M-86 for IBM PC appeared six months after the release of IBM PC, and the price was about six times that of DOS , so sales were sluggish. Many users flowed to IBM PC DOS, Microsoft acquired Tim Patterson 's project and MS-DOS was born.



QDOS , which is the base of PC DOS and MS - DOS, is inspired by CP / M in many respects, and it is said that command structure and API are similar to CP / M. At the same time, QDOS and PC-DOS 1.0 inherit the concept of special files such as AUX, PRN, CON, LPT from CP / M.

After that, PC-DOS 2.0 announced in 1983, support directory according to IBM PC XT with hard disk drive. However, the problem here was that in PC DOS 1.0 CP / M special files were used. Software was basically written assuming to use special files, and batch files also supported special files.

Therefore, the behavior taken by Microsoft is to maintain backward compatibility by "enabling all special file functions in all directories". This makes it possible to print directory listings with "DIR> LPT" even in C: \ DOS. This is the reason for the error.


After that, Windows 95 was made based on DOS and took over these behaviors. 2018 Windows currently being used is based on Windows NT rather than Windows 95, but in order to have compatibility with DOS and previous Windows programs, Windows NT uses "all the directories Activate the function of the special file "has taken over the property. This means that there are file names that can not be used even in Windows 7, Windows 8, Windows 10, etc., which are used as of 2018.

In addition, these files are written as "reserved words" on Microsoft's official page .

CONT, PRN, AUX, NUL, COM 1, COM 2, COM 3, COM 4, COM 5, COM 6, COM 7, COM 8, COM 9, LPT 1, LPT 2, LPT 3, LPT 4, LPT 5, LPT 6, LPT 7, LPT 8, and LPT 9.

in Software, Posted by darkhorse_log