Does Linux have a standard temporary directory for general use, like Windows's C:\Temp folder? If so, where is it located? I found an SO question about finding a tmp directory programmatically, but I want to set a temp location in an XML config file ahead of time.
| |||
|
feedback
|
|
The Filesystem Hierarchy Standard says:
and
| |||||||
feedback
|
|
Yes /tmp is for general use. See here and here On the Filesystem Hierarchy Standard.
With some more details listed in the PDF. | |||
|
feedback
|
|
You cannot choose a single temporary directory name ahead of time that will work for any Linux system. In fact, you can't do that on Windows either. According to Wikipedia's article on temporary folders, the temporary directory on Windows is determined by the environment variable TEMP. If you were simply using In short, the system temporary directory is determined by the environment on all modern operating systems that I know of, including both Windows and any UNIX-like system. Setting a single static path as your temporary directory will only work as long as the defaults have not been changed. Anyway, the standard temporary directory in a typical Linux system is You could try choosing a temporary directory relative to the user's home directory, which you can create. | |||||
feedback
|
/tmp, but they were ambiguous about whether that's standard for Linux or just a common convention. – Lord Torgamus Sep 6 '11 at 19:45C:\Tempis most certainly not standard. Windows 95 already had%TEMP%pointing toC:\WINDOWS\Temp. – grawity Sep 6 '11 at 21:31