Hacker News new | past | comments | ask | show | jobs | submit login

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_...




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: