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

Add OS-dependent path conversion under a well-documented library function: loc parseFilePath(str path, OS forOS=currentOS()) #1941

Closed
jurgenvinju opened this issue May 9, 2024 · 5 comments

Comments

@jurgenvinju
Copy link
Member

This would help when we source file paths as strings and need to convert them to locations. Since file path parsing is OS specific, we need an OS specific solution and not a generic one (also not an automatic one builtin to the ISourceLocation factories!)

@DavyLandman
Copy link
Member

Agreed, let's also add the inverse, as if you have to call exec, you have to write messy code, for this exact reason.

@jurgenvinju
Copy link
Member Author

jurgenvinju commented May 9, 2024 via email

@jurgenvinju
Copy link
Member Author

jurgenvinju commented May 9, 2024 via email

@DavyLandman
Copy link
Member

I'll try wip up an example, but there are enough cases where you need to have 'correct' paths in places that aren't possible with generic argument replacement of loc. Especially if you need them like inside of a config file, or some kind of composed argument. (For example "--glob <root.path>/**/*").

In general I agree some cases you don't have to worry (especially as windows handles / separated paths quite well).

@DavyLandman
Copy link
Member

@jurgenvinju this is done right? in #1942?

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

2 participants