Get rid of CP/M reserved file names #444

Closed
opened 2026-01-30 21:52:32 +00:00 by claunia · 5 comments
Owner

Originally created by @be5invis on GitHub (Nov 3, 2018).

I mean, CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9, At least when used with a extension (like AUX.txt rather than single AUX).

Originally created by @be5invis on GitHub (Nov 3, 2018). I mean, `CON`, `PRN`, `AUX`, `NUL`, `COM1`, `COM2`, `COM3`, `COM4`, `COM5`, `COM6`, `COM7`, `COM8`, `COM9`, `LPT1`, `LPT2`, `LPT3`, `LPT4`, `LPT5`, `LPT6`, `LPT7`, `LPT8`, and `LPT9`, At least when used with a extension (like `AUX.txt` rather than single `AUX`).
claunia added the Resolution-By-DesignResolution-External labels 2026-01-30 21:52:32 +00:00
Author
Owner

@HBelusca commented on GitHub (Nov 4, 2018):

You surely break scripts (batch files) that rely on these.
One idea would be to have a CMD.exe switch that can disable these special names.
Also, some of these names are specially handled in the RTL of ntdll.dll.

@HBelusca commented on GitHub (Nov 4, 2018): You surely break scripts (batch files) that rely on these. One idea would be to have a CMD.exe switch that can disable these special names. Also, some of these names are specially handled in the RTL of ntdll.dll.
Author
Owner

@be5invis commented on GitHub (Nov 4, 2018):

@HBelusca
I do not think someone would write whatever > NUL.txt instead of whatever > NUL.
Do we have telemetry?

@be5invis commented on GitHub (Nov 4, 2018): @HBelusca I do not think someone would write `whatever > NUL.txt` instead of `whatever > NUL`. Do we have telemetry?
Author
Owner

@doubleyewdee commented on GitHub (Nov 23, 2018):

Isn't the problem with these filenames buried much deeper in Win32-land? I didn't think this was under the control of cmd.exe (or PowerShell.exe) themselves. Amusingly I successfully made a file called 'NUL' from WSL in my $TEMP dir in Windows but nothing in cmd/powershell wants to interact much with it. 🙃

@doubleyewdee commented on GitHub (Nov 23, 2018): Isn't the problem with these filenames buried much deeper in Win32-land? I didn't think this was under the control of cmd.exe (or PowerShell.exe) themselves. Amusingly I successfully made a file called 'NUL' from WSL in my $TEMP dir in Windows but nothing in cmd/powershell wants to interact much with it. 🙃
Author
Owner

@HBelusca commented on GitHub (Nov 23, 2018):

The Windows team would just have to modify RtlIsDosDeviceName_U() and RtlIsDosDeviceName_Ustr() (in ntdll) to return 0 everytime in order to disable checks for "DOS device names" (as these COM/LPT/... are called).

@HBelusca commented on GitHub (Nov 23, 2018): The Windows team would just have to modify `RtlIsDosDeviceName_U()` and `RtlIsDosDeviceName_Ustr()` (in ntdll) to return 0 everytime in order to disable checks for "DOS device names" (as these COM/LPT/... are called).
Author
Owner

@zadjii-msft commented on GitHub (Nov 26, 2018):

I concur with @doubleyewdee. There's nothing that my team is going to be able to do that, and changing this behavior would be a massive compat nightmare.

Sure, the code change itself might be easy, but the potential fallout would be incalculable. I'm gonna go ahead and just say no on this one.

@zadjii-msft commented on GitHub (Nov 26, 2018): I concur with @doubleyewdee. There's nothing that my team is going to be able to do that, and changing this behavior would be a massive compat nightmare. Sure, the code change itself _might_ be easy, but the potential fallout would be incalculable. I'm gonna go ahead and just say no on this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#444