TMPDIR
{{Refimprove|date=December 2009}}
TMPDIR
is the canonical environment variable in Unix and POSIX{{cite web|url=https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html|title=Environment Variables|website=Pubs.opengroup.org|access-date=26 October 2017}} that should be used to specify a temporary directory for scratch space. Most Unix programs will honor this setting and use its value to denote the scratch area for temporary files instead of the common default of {{mono|/tmp}}{{Cite web| url = https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap10.html#tag_10_01 | title = The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008, Base Definitions volume: Directory Structure and Files: /tmp | publisher = The Open Group | access-date = 2011-04-02}}{{Cite web| url = https://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES | title = Filesystem Hierarchy Standard, version is 2.3: /tmp: Temporary files | publisher = Linux Foundation | access-date = 2010-06-13}} or {{mono|/var/tmp}}.{{Cite web| url = https://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE | title = Filesystem Hierarchy Standard, version is 2.3: /var/tmp: Temporary files preserved between system reboots | publisher = Linux Foundation | access-date = 2010-06-13}}
Other forms sometimes accepted are TEMP
, TEMPDIR
and TMP
, but these alternatives are used more commonly by non-POSIX operating systems or non-conformant programs.
TMPDIR
is specified in various Unix and similar standards, e.g. per the Single UNIX Specification.{{Cite web| url = https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 | title = The Open Group Base Specifications Issue 7, IEEE Std 1003.1-2008, Base Definitions volume: Environment Variables: Other Environment Variables: TMPDIR | publisher = The Open Group | access-date = 2011-04-02}}
See also
References
{{Reflist}}
{{DEFAULTSORT:Tmpdir}}
Category:Unix file system technology
Category:Environment variables
{{Unix-stub}}