Is there a common practice where to save temporary files on macOS? Currently I'm using /tmp but I often see the folder /var/folders in use for saving temporary files.
Is there a suggested way?
Thanks!
Is there a common practice where to save temporary files on macOS? Currently I'm using /tmp but I often see the folder /var/folders in use for saving temporary files.
Is there a suggested way?
Thanks!
I don't know of any official guide, but I would say:
use /tmp
for temporary things that do not need to survive a reboot
use /var/tmp
for temporary things that do need to survive reboot
On my system at least, /var/folders
is quite restricted in who can access it:
drwxr-xr-x 4 root wheel 136 28 Oct 2015 /var/folders