5 ms·
Isn't that what /tmp is for? Why not put cache files into /tmp/<username> with 0700 permission?
by yaix 14y ago
Isn't that what /tmp is for? Why not put cache files into /tmp/<username> with 0700 permission?
- daxelrod 14y agoNo, 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#TMPTEMPORARYFILES http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFIL... [2]: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARY... [3]: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICA... [4]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_...