fs icon indicating copy to clipboard operation
fs copied to clipboard

make home work properly

Open Raynes opened this issue 13 years ago • 8 comments
trafficstars

https://github.com/Raynes/fs/commit/1b5e18ee9bc83a5bcaaddbf7f9667834b0cf7f87#commitcomment-796025

Blah. This can be fixed, but boy will it be ugly.

Raynes avatar Dec 15 '11 05:12 Raynes

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 avatar Dec 18 '11 05:12 Raynes

@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.)

xpe avatar Jan 04 '15 19:01 xpe

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 avatar Jan 04 '15 21:01 Raynes

@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?

xpe avatar Jan 05 '15 01:01 xpe

Please read the linked thread. The problem is clearly defined.

~<user>/foo

We don't currently have a way to tell where 's home directory actually is. $HOME is not remotely cross platform, let alone even reliably set in every environment. Not sure how much more I can explain :P

Raynes avatar Jan 05 '15 01:01 Raynes

It's not necessarily hard either, I just haven't bothered.

Raynes avatar Jan 05 '15 01:01 Raynes

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.

xpe avatar Jan 05 '15 02:01 xpe

Fantastic question. Is there?

Raynes avatar Jan 05 '15 03:01 Raynes