-
Notifications
You must be signed in to change notification settings - Fork 145
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
Absolute child is error prone #88
Comments
I think we need to implement a typed path for relative and absolute paths to prevent stuff like this |
Yup, @lihaoyi has the right idea in ammonite about typing paths. Paths would also address some of the fuzziness regarding files that actually exist on the file system vs. doing operations on paths (see my comment here: #89 (comment) where I don't have a good answer for if See also: https://github.com/slamdata/scala-pathy |
Hello better-files! It would be nice and handy to have kind of "getPathWithAnchor" functionality, with following semantics (which is really similar to java.nio.file.Path.resolve, with one twist - it supports either dir or file as reference):
The main use case for this functionality is e.g. when you are dealing with configuration files The main differences compared to
Maybe this could be something like that with
or even
And usage would be something like: val home = File("/User/johndoe/") In my soap-box this would really handy. What do you think? If this makes sense, then I can provide PR for this feature. P.S. There is one implementation of that here (I am an author of sn127, so MIT licensing some of that code / tests won't be problem): |
@jaa127 : Although your suggestion does not resolve the original bug this issue pertains to but it definitely makes sense and so please submit a PR.
|
@jaa127 What you propose is really interesting, I would like to see it in better-files, especifically now that we're adding it as a Scala Platform module! Are you thinking of contributing it? We would really welcome such a PR and we can help you out getting it done. |
@jvican Thanks! Fortunately @pathikrit has already merged that feature (PR #113), so it should/will be in v3.0.0. |
Aha, so you already did! @jaa127 😉 Cool to see this merged. We have some other issues that you may want to play around with -- we're currently trying to prepare for a release in the Scala Platform, the next community-maintained Scala library that will replace the current standard library in 2.13. |
"append" an absolute child is error prone, and not consistent with
Bash
.With
Bash
:/tmp/aBackupDir//home/user/.bashrc.bak
The text was updated successfully, but these errors were encountered: