Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMn and LPTn with 1-3 superscripts are not accounted for #73

Open
colejohnson66 opened this issue Nov 4, 2024 · 0 comments
Open

COMn and LPTn with 1-3 superscripts are not accounted for #73

colejohnson66 opened this issue Nov 4, 2024 · 0 comments

Comments

@colejohnson66
Copy link

colejohnson66 commented Nov 4, 2024

Windows restrictions on COMn and LPTn include digits one through nine as well as superscripted digits one through three. Specifically, U+00B9, U+00B2, and U+00B3. See the note under "naming conventions": https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#file-and-directory-names

case 4:
// disallow com? and lpt? where ? can be any number from 1 to 9
name = name.TrimEnd("123456789".AsSpan());
return name.EqualsOrdinalIgnoreCase("com") || name.EqualsOrdinalIgnoreCase("lpt");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant