1
yuzo555 2022-04-29 21:22:44 +08:00
设备名称,类似的有 nul 、aux 、prn 、com1 、com2
|
2
learningman 2022-04-29 21:23:18 +08:00
con 在 Windows 上是 console 设备的名字
但是 con.py 应该是没问题的吧。。。 |
3
yzwduck 2022-04-29 21:43:08 +08:00 1
@learningman CON.PY 也一样会有兼容性问题,除非加上 \\?\ 前缀。
文档 https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file Old New Things 写过一篇解释 "What's the deal with those reserved filenames like NUL and CON?" https://devblogs.microsoft.com/oldnewthing/20031022-00/?p=42073 |
4
learningman 2022-04-29 21:45:38 +08:00
@yzwduck 看到了
Because it turns off automatic expansion of the path string, the "\\?\" prefix also allows the use of ".." and "." in the path names, which can be useful if you are attempting to perform operations on a file with these otherwise reserved relative path specifiers as part of the fully qualified path. Many but not all file I/O APIs support "\\?\"; you should look at the reference topic for each API to be sure. Note that Unicode APIs should be used to make sure the "\\?\" prefix allows you to exceed the MAX_PATH |
5
MiketsuSmasher 2022-04-30 07:34:27 +08:00
不错,Windows 真够屎山
|