Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If your Mac has multiple users, putting your downloads and screenshots in /tmp might make them visible to anyone else logged in to the machine.


MacOS has a $tmpdir env var that you could use instead, it's mapped per-user.

I think /tmp/ is auto-mapped to /private/tmp though, which is also user-specific.


Ah I didn't know that; not a frequent Mac user.

Edit: after a bit of web searching, I'm not finding any suggestion that /private is somehow mapped per-user. Is this actually true?


/private and /private/tmp are shared between all users (including non-login users). $TMPDIR is safer for sensitive files, but it lacks the macOS sandboxing protection on ~/Downloads.


The article mentions /tmp is symlinked to /private/tmp




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: