[Haskell-cafe] Abstracting configuration directories
Joeri van Eekelen
j.v.eekelen at gmail.com
Fri Dec 20 17:51:39 UTC 2013
I think the "right" way to accomplish this is through the Paths_pkg
module generated by Cabal:
Specifically, the getDataFile function can be used to look up the actual
location of files specified in the data-files: field of the .cabal file.
This should even work if someone uses a nonstandard --prefix.
On 2013-12-20 12:29, Henk-Jan van Tuyl wrote:
> On Thu, 19 Dec 2013 18:15:09 +0100, Michael Orlitzky
> <michael at orlitzky.com> wrote:
>> On 12/19/2013 01:40 AM, Tim C. Schroeder wrote:
>>> I think this is what you're looking for:
>> getAppUserDataDirectory will give me the user's configuration directory
>> (ala $HOME/.htsnrc), but not the global one (whatever I'm supposed to
>> use instead of /etc on Windows).
> You could use the environment variable AllUsersProfile for this.
> The directory package should be extended with a function
> Henk-Jan van Tuyl
>  http://environmentvariables.org/AllUsersProfile
Joeri van Eekelen - j.v.eekelen at gmail.com
More information about the Haskell-Cafe