Expected Config File Locations

Smylers Smylers at stripey.com
Tue Aug 30 15:59:04 BST 2011

Philip Newton writes:

> On Tue, Aug 30, 2011 at 14:55, Smylers <Smylers at stripey.com> wrote:
> >  I see that psql uses %APPDATA%\postgesql\psqlrc.conf for per-user
> >  config
> I think that on Windows, the application data directory hierarchy is
> the right place for programs to store their own configuration data

Hi Philip. Thanks for your reply.

> (the exact name of the directory depends on the version of the OS:
> it's better to ask the system for the physical path corresponding to
> the logical name "foo" than to hard-code the thing).


> On the other hand, that's not a place most people dig around in,
> themselves. So if it's a configuration file you expect the user to
> edit, then the home directory or a sub directory might be better

Yes, that's what I'm dealing with. I want to put in the command's
documentation 'instead of providing option --zok in the command line
every time, put it in the config file called ...'.

Though it seems to me it's also the psql situation. Any Windows psql
users here: does the location of psqlrc.conf seem convenient,
irritating, or so obscure to you that it's news you could even have such
a file?

If I do use the home directory, any preferences for the name?

> (depending partly on whether you expect to have only one config file
> or [potentially] several).

I'm sure it'll only be one. (Though I'm guessing when ~/.muttrc and
~/.vimrc were added their developers also thought that ...)

> There may be a difference between $HOME (aka %HOME%),
> %HOMEDRIVE%%HOMEPATH%, and the home directory you get through a system
> call, though....

I was planning on using File::HomeDir, which seems to've been well
researched to DTRT.

> > * Most Windows systems seem to be single-user; do I even need both
> >  system-wide and per-user locations on Windows, and if not which one
> >  would you expect to find?
> Many programs ask, when they get installed, whether to install it for
> "just the current user ($name)" or for "all users".

Do Cpan modules? Can I detect which of those was chosen?


Watch fiendish TV quiz 'Only Connect' (some questions by me)
Mondays at 20:30 on BBC4, or iPlayer: http://www.bbc.co.uk/onlyconnect

More information about the london.pm mailing list