Finding where to store application data portably

Steve Holden steve at holdenweb.com
Wed Sep 21 10:33:19 EDT 2005


Steven D'Aprano wrote:
> 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>
> 
> 
While we're asking for the improbable, perhaps we could make that

   ~/.settings/app-name

Ssh has used the ~/.ssh directory for a long time to avoid the need for 
lots of little dot files, and this works quite well. Good luck in your 
campaign!

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                          www.pycon.org




More information about the Python-list mailing list