What's the perfect (OS independent) way of storing filepaths ?
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Thu Oct 23 00:00:34 EDT 2008
On Tue, 21 Oct 2008 10:00:35 -0500, Grant Edwards wrote:
>> It is true that all kinds of programs will create .app files in your
>> home dir which is not very polite.
>
> It _is_ polite. Polite means following the established rules and doing
> what's expected of you. That's exactly what is expected of applications
> under Unix.
In medieval Russia, the Rus vikings (from whom modern Russia gets its
name) used to live in communal log huts. In the morning, a slave would
bring along a great big steaming bowl of water for the Rus to wash their
faces in. *One* bowl. The first person would wash his face, blow his nose
and spit in the bowl, then pass it on to the next person, who would
repeat all down the line.
This was the established social rules and everybody did what was expected
of them. It was also as rude as hell, and not just because "rude" also
means "unpolished, uncultured".
Putting preferences files in the user's top level directory is horribly
inconvenient for the user. It clutters their home directory. The old-time
Unix people recognised this, and made the files hidden so that their mess
wasn't visible. It certainly wasn't to protect the user from themselves,
because their users were other old-time Unix geeks who not only were
comfortable editing config files but expected to be able to. No, the only
reason for hiding the config files was because otherwise the user's home
directory would be too messy.
But of course all that means is that you avoid the mess so long as you
don't look at it. I have 125 dot files in my home directory. They include
"temporary" files from programs I haven't run in months, settings from
applications I haven't even heard of (where the hell did
".parallelrealities" come from?), log files, lock files and other dross
that has no place scattered across my home directory. Half of these files
contain important data which users will invariably miss when making
backups, and half of them are junk that don't need to be copied when
making backups (e.g. .thumbnails, .Trash), but there's no easy way to
include some while excluding others.
It may be expected, but it is still inconsiderate and just plain
*stupid*. A thirty year old stupidity is still a stupidity.
It would have been easy to avoid this: just copy the relevant bits of
the / directory hierarchy in the user's home directory. Global settings
go in /etc and per user settings go in ~/etc. Global temp files go into /
tmp and per user temp files go into ~/tmp. And so forth. Nice, neat and
perfectly easy to implement and easy to deal with.
--
Steven
More information about the Python-list
mailing list