6 ms·
I knew of NUL, CON, COM#, PRN and LPT# restrictions but never heard of AUX... today I learned two more! "The following reserved device names cannot be used as
by no_news_is 9y ago
I knew of NUL, CON, COM#, PRN and LPT# restrictions but never heard of AUX... today I learned two more!
"The following reserved device names cannot be used as the name of a file: CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. In addition, any combinations of these with extensions are not allowed."
Restrictions on the File Mask and File Name Properties
https://msdn.microsoft.com/en-us/library/aa578688.aspx https://msdn.microsoft.com/en-us/library/aa578688.aspx
- qubex 9y agoI didn't know about CLOCK$
- FrozenVoid 9y agohttps://everything2.com/title/clock%2524 https://everything2.com/title/clock%2524
- squeaky-clean 9y agoI only learned about these when I was trying to scrape information about airports and save each in their own folder named after their IATA code. I learned about NUL, PRN and CON because of Nulato Airport, Pristina International Airport and Concord Municipal Airport. Such a weird bug, I didn't know why I was getting a FileNotFoundError from trying to create a new file. Everything online will tell you the directory you're placing it in doesn't exist (it did of course), and no hint that you're trying to use a magic name.
- phkahler 9y agoThey did it wrong then. IFF you have to map stuff to files they should all be located under /dev/ and not confuse the system if someone happens to use those strings for their own file names in their own places.
- sixbrx 9y agoAgree but these came from DOS days, and were just always brought along for compatibility. I think it could be argued that there's such a thing as too much attention to compatibility... Edit: MOST of the no-no file names come from DOS, not this $MFT one which is NTFS related so must have come later!
- phkahler 9y ago>> I think it could be argued that there's such a thing as too much attention to compatibility... I'm convinced that most problems people face are rooted in the conflict between short and long term goals.
- peteri 9y agoWell they really come from CP/M and PIP which sort of inherited from DEC OS/8 (certainly they're in the 1973 manual)
- diet_mtn_dew 9y agoThose special files date back to MS-DOS 1.0, which did not have directories. There's some explanation in the blog post below. https://blogs.msdn.microsoft.com/oldnewthing/20031022-00/?p=42073 https://blogs.msdn.microsoft.com/oldnewthing/20031022-00/?p=...