Even if Microsoft keeps this behavior, I'm surprised they don't modify it to check the filename extension. It's one thing to change a device like CON that people might expect to exist, but it seems like not distinguishing CON and con.c is just asking for trouble.
The tale of aux.c
11–20 of 129 posts
Re: The tale of aux.c
#12Re: The tale of aux.c
#13 mkdir \\?\V:\con
notepad \\?\V:\con\aux.txt
This avoids reserved filenames as well as 260-character length restriction. But many programs that try to do any path processing fail after seeing an unexpected prefix, even File Open dialog (on Win7 at least).Re: The tale of aux.c
#14Even if Microsoft keeps this behavior, I'm surprised they don't modify it to check the filename extension. It's one thing to change a device like CON that people might expect to exist, but it seems like not distinguishing CON and con.c is just asking for trouble.
That behavior is intentional and is workaround for programs that does not let user change file extension on saving.
Now it's just because some code hidden away under 10s of layers a millions of lines in some obscure line-of-business applications is accidentally dependent on this quirk and "it works now" and no one will ever fix it.
Re: The tale of aux.c
#15Re: The tale of aux.c
#16Earlier quoted context omitted.
That behavior is intentional and is workaround for programs that does not let user change file extension on saving.
The funny part is, that is not the purpose at all any more. It was probably only for a handful of years that this trick was needed to "trick" programs which thought they were saving a normal file and forcing the correct extension to actually use a printer or serial port. No one has used a printer or serial port by File -> Save As to "lpt.txt" in decades! Now it's just because some code hidden away under 10s of layers…
Re: The tale of aux.c
#17Earlier quoted context omitted.
The funny part is, that is not the purpose at all any more. It was probably only for a handful of years that this trick was needed to "trick" programs which thought they were saving a normal file and forcing the correct extension to actually use a printer or serial port. No one has used a printer or serial port by File -> Save As to "lpt.txt" in decades! Now it's just because some code hidden away under 10s of layers…
This isn't an issue for contemporary human facing UIs. Somewhere there is guaranteed to be a crusty POS system still in use that is sending receipt data to LPT.TXT or AUX.TXT.
I think they just keep it because it feeds into the backwards compatibility myth that MS has built up.
Re: The tale of aux.c
#18Earlier quoted context omitted.
It doesn't even make sense to hold this position. Aux.c isn't even a usefully descriptive name for a file you'd find in a mua.
A legacy requirement to not ever have any files with a basename of CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, or LPT9 doesn't make sense either :)
Re: The tale of aux.c
#19Re: The tale of aux.c
#20We ran into this issue in Servo too. https://github.com/servo/servo/issues/1226