Windows:ファイル名で使えない文字列
MS-DOS の頃の仕様をひきずっている。
予約デバイス名
table:special_file_name
AUX
CON
NUL
PRN
CLOCK$
COMn (nは正の整数)
LPTn (nは正の整数)
拡張子を外した状態で判定する必要がある。
拡張子を付けても回避できない。
Windowsパス名の落とし穴 https://www.ipa.go.jp/security/awareness/vendor/programmingv1/b08_01_main.html
Naming Files, Paths, and Namespaces https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
Do not use the following reserved names for the name of a file:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.
Windows 11 からは普通のファイル名として使えるようになったという報告あり。