
Hi Felix, You have described your own style of using some of the Window's Known Folders. In my opinion your style is a bit Unixy, but that's fine, you should be allowed to do it that way in GHC. But GHC should not force others to do it only that way. btw, years ago I used to use the Profile folder as if it were a "home directory". It caused me no end of problems. But if it works for you, it should certainly be possible for you to do it that way. I wrote:
The %HOMEPATH% variable should definitely not be used. The folder that it points to is not a "home directory" and should not be used that way.
Felix Martini wrote:
That's not correct. It is the user's home folder aka user profile folder
No, the two are not the same. It is the User Profile folder. It is not a Unix-style home directory - there is no such concept on Windows. The two are used very differently.
see e.g. http://support.microsoft.com/kb/101507.
That is an ancient article about NT 4.0, and even then it was only about how to deal with legacy scripts back in those days.
The environment variables %homedrive% and %homepath% are set by Windows for use by (legacy) scripts. Think of them as readonly variables. Modifying environment variables is not a Windows convention. There are other ways to change the location of a user's profile folder.
Correct. That is one of the reasons that this folder is not suitable for use as a home directory.
By "reasonable alternative", I mean a way that users can configure GHC's notion of "home directory" at run-time on Windows.
This is not a task for GHC, but Windows itself. GHC should just use the win api to ask Windows for the user's home folder. That is the current behaviour.
It is not the current behavior, and it is not a task for Windows. Windows will never do it. There is no such thing as a "home folder" on Windows. The new current behavior is to ask the Windows API for the user's Profile folder, and force it to be used as if it were a "home directory". That is wrong. As long as GHC has a built-in notion of "home directory", which doesn't exist on Windows, there needs to be a user-configurable way to specify what to do instead, as there always was until now. It depends on a lot of factors - exactly how are you using this "home directory", how does it interact with other apps, details about the platform, etc.. If nothing is specified, then, as a last resort, there is no choice but to use the Profile folder as the default. As Duncan Coutts pointed out, the getAppUserDataDirectory function makes much more sense - that is a notion that ought to exist on all platforms.
This is the ideal solution for ghci on Windows.
Yes, that is the right place to put the ".ghci" file. Ach, here I go again. I've got to get back to work... Regards, Yitz