logoalt Hacker News

ryandrakeyesterday at 4:11 PM2 repliesview on HN

In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.


Replies

wpollockyesterday at 4:49 PM

> In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.

/tmp must be world-writable and for multi-user or multi-tenant systems it becomes a security hole. Storing temporary files in the current user's home directory (or a subdirectory thereof) makes sense.

What doesn't make sense is this blog post about TMP and TEMP, and ending with "I don't know why" (in different words).

The reason is simple: different programmers thought the other name was bad. They were under no obligation to come to a consensus.

Don't forget about TEMPDIR and TMPDIR! Also Windows has its own environment variables for this. But generally, Linux software ported to Windows still use TMP or TEMP.

show 1 reply