You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not use the following reserved names for the name of a file:
CON, PRN, AUX, NUL, COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, COM¹, COM², COM³, LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, LPT¹, LPT², and LPT³. Also avoid these names followed immediately by an extension; for example, NUL.txt and NUL.tar.gz are both equivalent to NUL. For more information, see Namespaces.
I think we should discuss a nice way to deal with it in Mill. Mill currently assumes all legal class names are supported. But having a target named con can fail on Windows with a uninformative error message. Since we create metadata files unter out/ like con.json, con.log and con.dest, which would all be illegal under a Windows file system namespace.
The text was updated successfully, but these errors were encountered:
A rather simple and generic way could be to append a single character to all or only those reserved names. For example an underscore (_). Or the more Windows typical tilde (~). Resulting in names like con~.json, con~.json and con~.dest.
In case a segment path matches one of the reserved name of the Windows
filesystem namespace, we insert a `~` directly after the offending
segment part.
Here is a excerpt from an official [Win32
documentation](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#naming-conventions):
> * Do not use the following reserved names for the name of a file:
>
> CON, PRN, AUX, NUL, COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7,
COM8, COM9, COM¹, COM², COM³, LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6,
LPT7, LPT8, LPT9, LPT¹, LPT², and LPT³. Also avoid these names followed
immediately by an extension; for example, NUL.txt and NUL.tar.gz are
both equivalent to NUL. For more information, see
[Namespaces](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#win32-file-namespaces).
We do the insertions on all platforms, not only Windows, for consistency
of the `out/` folder.
Fix#2961
Pull request: #2964
In PR #2959 I run into a hard diagnose issue with file names on MS Windows.
Here is a excerpt from an official Win32 documentation:
I think we should discuss a nice way to deal with it in Mill. Mill currently assumes all legal class names are supported. But having a target named
con
can fail on Windows with a uninformative error message. Since we create metadata files unterout/
likecon.json
,con.log
andcon.dest
, which would all be illegal under a Windows file system namespace.The text was updated successfully, but these errors were encountered: