How do I find the \'temp\' directory in Linux? I am writing a platform neutral C++ function that returns the temp directory. In Mac and Windows, there is an API that returns
Use the value of the $TMPDIR environment variable, and if that doesn't exist, use /tmp.
/tmp