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

\ is a valid filename character on Linux #53

Open
king-of-poppk opened this issue Jan 19, 2024 · 3 comments
Open

\ is a valid filename character on Linux #53

king-of-poppk opened this issue Jan 19, 2024 · 3 comments

Comments

@king-of-poppk
Copy link

Was this overlooked?

@king-of-poppk king-of-poppk changed the title \\ is a valid filename character on Linux \ is a valid filename character on Linux Jan 19, 2024
@anodynos
Copy link
Owner

Isn't \ an escape character? Can you provide some examples?

@king-of-poppk
Copy link
Author

touch "a\\b" or touch 'a\b'

@anodynos
Copy link
Owner

anodynos commented Jun 17, 2024

Well, it seems its a valid char indeed... this is clearly not handled & I am not sure how it should be best handled.

On Windows it's considered a path separator, hence a filename with it is converted to the unix separator.

We need to somehow decide we are coming from a Unix path and it's a normal char, and it should not be converted to a unix dir separator. But I think there is no straight forward way to determine if the \ symbol denotes a normal char in a unix filename or if it is originated from a Windows file path, therefore it's a dir separator.

I think thought it's a very rare case though, noone else has raised this issue...

Any ideas or PRs are welcome ;-)

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

No branches or pull requests

2 participants