Finding where to store application data portably

Steven D'Aprano steve at REMOVETHIScyber.com.au
Wed Sep 21 16:23:56 CEST 2005


On Tue, 20 Sep 2005 23:03:52 +0100, Tony Houghton wrote:

> I'm using pygame to write a game called Bombz which needs to save some
> data in a directory associated with it. In Unix/Linux I'd probably use
> "~/.bombz", in Windows something like
> "C:\Documents And Settings\<user>\Applicacation Data\Bombz".

In Windows, you shouldn't hard-code the drive letter. I don't know how you
find out what the correct value is, but hard-coding it is just Bad.

As a Linux user, I really am sick of every damn application, script and
program under the sun filling the top level of my home directory with
dot-files.

I wish the Linux Standard Base folks would specify that settings files
should all go into a subdirectory like ~/settings rather than filling up
the home directory with cruft. That was acceptable in the days when people
only looked at their files with ls, but in these days of GUI file
managers, it is ridiculous that there are more than 100 dot files and
directories in my home directory.

<tilting at windmills>

Can I ask developers to break with the obsolete and annoying habit of
creating user-specific config files as ~/.app-name and use
~/settings/app-name instead?

</tilting at windmills>


-- 
Steven.




More information about the Python-list mailing list