News for hackers. Stuff that matters.
Re:Rob Pike: the origin of dotfiles by keyist on Thursday August 02, 2012 @10:48PM (#4332276)
I consider it good practice to allow users to customize where your program creates files. I don't like $HOME to be the default dumping ground for anything I run.

A standard that uses environment variables means programs don't have to provide extra options for this customization (I've seen -f,--file , -c,--config and other variants). It allows for common code (libraries that implement the spec).

If you poke around for feature requests for various open source programs, you'll find XDG basedir compliance come up occasionally (moreso for CLI utils). I wouldn't say "nobody seems to be using it"; quick scan of my folders includes Chromium, uzbl, htop. Git's next release will be compliant too.

Re:Rob Pike: the origin of dotfiles by tedunangst on Friday August 03, 2012 @12:56AM (#4332610)
I don't particularly like dumping everything in home, but XDG is worse. Now, if I want to start over with a clean profile, there's a whole list of locations I have to zap. Spraying shit in three directories is worse than one.
Re:Rob Pike: the origin of dotfiles by johnny22 on Friday August 03, 2012 @01:49AM (#4332761)
my problem with that "one" directory is that i have to take care specifically to back it up. applications that at least use ~/.cache means i don't have to worry about backing up a bunch of useless stuff.
Re:Rob Pike: the origin of dotfiles by yaix on Saturday August 04, 2012 @08:51AM (#4338338)
Isn't that what /tmp is for? Why not put cache files into /tmp/<username> with 0700 permission?
Re:Rob Pike: the origin of dotfiles by daxelrod on Saturday August 04, 2012 @06:44PM (#4339927)
No, that's not necessarily what /tmp is for.

Consider a browser cache. /tmp is not guaranteed to be preserved between program invocations[1]. /var/tmp [2] might be a better place. /var/cache [3] is intended for exactly this kind of thing.

Unfortunately, it can be far more useful for an administrator in a multi-user setup to want user-specific caches in home directories. That way, you get all of the infrastructure for managing user data for free, like quotas.

Also note: if you're considering putting data into /tmp or /var/tmp, please honor the TMPDIR environment variable, if it is set[4].

[1]: http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFIL...

[2]: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARY...

[3]: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICA...

[4]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_...

Re:Rob Pike: the origin of dotfiles by anamax on Friday August 03, 2012 @03:58PM (#4335866)
> If you poke around for feature requests for various open source programs, you'll find XDG basedir compliance come up occasionally (moreso for CLI utils).

What fraction of those requests are by XDG advocates?

I ask because every standard comes with folks insisting that it be followed. While those folks claim to represent the interests of users, those requests are different.

Re:Rob Pike: the origin of dotfiles by adbge on Friday August 03, 2012 @05:13PM (#4336214)
I have made this specific feature request on an application (Mangler) and I have no affiliation with XDG.