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

makeRelative never introduces "../" #10

Closed
mgsloan opened this issue Mar 28, 2016 · 1 comment
Closed

makeRelative never introduces "../" #10

mgsloan opened this issue Mar 28, 2016 · 1 comment

Comments

@mgsloan
Copy link

mgsloan commented Mar 28, 2016

This is due to how the implementation in filepath works - https://hackage.haskell.org/package/filepath-1.4.1.0/docs/System-FilePath-Posix.html#v:makeRelative . While somewhat "correct" to never yield "../", I find that behavior fairly useless. We should choose the behavior that will reduce unexpected errorcases in user code. If .. does go up a directory, then it should be used. Otherwise throw some error like "Couldn't make /some/abs/path relative /a/wonky/path because they don't straightforwardly share an ancestor"

@mrkkrp
Copy link
Owner

mrkkrp commented Mar 29, 2016

AFAIK, it's not possible to construct a Path with .. segment in it anyway, see: commercialhaskell/path#8. For example:

λ> parseRelFile "../something.txt"
*** Exception: InvalidRelFile "../something.txt"

@mrkkrp mrkkrp closed this as completed Jun 30, 2016
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