Open Raynes opened 12 years ago
Bandaid on the wound. I made it so that the path expansion stuff is explicit. We really do need to fix home
though (which would fix path expansion as a side effect).
@Raynes Does this problem remain? Perhaps it would help to add a small number of examples to reproduce the problems? (I'm about to start digging into ~ expansion with Java interop, so I can lend another set of eyes.)
Yes. I'm not sure what I could add as an example. The problem is that fs doesn't actually know where ~<user>
leads, because it doesn't necessarily have to be /home/<user>
.
@Raynes I don't see any examples. When I dig through the link above, I don't see a clear statement of the problem.
Now, at the risk of having no clarity on what the actual problem is, why is this hard? Why not just lookup the $HOME environment variable and convert ~ to it?
Please read the linked thread. The problem is clearly defined.
~<user>/foo
We don't currently have a way to tell where $HOME
is not remotely cross platform, let alone even reliably set in every environment. Not sure how much more I can explain :P
It's not necessarily hard either, I just haven't bothered.
System.getProperty("user.home")
works most of the time according to http://stackoverflow.com/questions/585534. Surely there is a respectable Java library that has already solved this?
Correction: System.getProperty("user.home")
not $HOME
.
Fantastic question. Is there?
https://github.com/Raynes/fs/commit/1b5e18ee9bc83a5bcaaddbf7f9667834b0cf7f87#commitcomment-796025
Blah. This can be fixed, but boy will it be ugly.