Bug 24058 – Everywhere exists con

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2023-07-26T09:37:39Z
Last change time
2023-07-26T13:15:56Z
Assigned to
No Owner
Creator
Kuan Hsu

Comments

Comment #0 by nagahiro.kyo — 2023-07-26T09:37:39Z
Simple Code: module test; import std.stdio, std.file; void main() { if( exists( "C:\\con.d" ) ) writefln( "EXIST!" ); writefln("END"); } I try at DMD2.104 and LDC1.33, the EXIST! always show, even I change the path to other indeed existed path still the same. I've tried: if( exists( "con" ) ) writefln( "EXIST!" ); Still print EXIST! x64 and x86 with the same issue.
Comment #1 by nick — 2023-07-26T10:07:32Z
Neither of those are valid user filenames, they are reserved: https://superuser.com/questions/86999/why-cant-i-name-a-folder-or-file-con-in-windows
Comment #2 by alphaglosined — 2023-07-26T13:15:56Z
As this is a feature of the Windows kernel, I am marking this as WONTFIX. D's behavior is correct for the platform.