Temporary folder

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by imported>WikiCleanerBot at 03:33, 18 March 2022 (v2.04b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation)). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Script error: No such module "Unsubst".

In computing, a temporary folder or temporary directory is a directory used to hold temporary files. Many operating systems and some software automatically delete the contents of this directory at bootup or at regular intervals, leaving the directory itself intact.

For security reasons, it is best for each user to have their own temporary directory, since there has been a history of security vulnerabilities with temporary files due to programs incorrect file permissions or race conditions.

A standard procedure for system administration is to reduce the amount of storage space used (typically, on a disk drive) by removing temporary files. In multi-user systems, this can potentially remove active files, disrupting users' activities. To avoid this, some space-reclaiming procedures remove only files which are inactive or "old" - those which have not been read or modified in several days.

Practical issues

In Unix, the /tmp directory will often be a separate disk partition. In systems with magnetic hard disk drives, performance (overall system IOPS) will increase if disk-head movements from regular disk I/O are separated from the access to the temporary directory. Increasingly, memory-based solutions for the temporary directory or folder are being used, such as "RAM disks" set up in random-access memory or the shared-memory device <templatestyles src="Mono/styles.css" />/dev/shm in Linux.

A Flash-based solid-state drive is less suitable as a temporary-storage device for reading and writing due to the asymmetric read/write duration and due to wear. (See wear leveling.)

Traditional locations

In MS-DOS and Microsoft Windows, the temporary directory is set by the environment variable <templatestyles src="Mono/styles.css" />TEMP or <templatestyles src="Mono/styles.css" />TMP.[1] Using the Window API, one can find the path to the temporary directory using the <templatestyles src="Mono/styles.css" />GetTempPath2 function,[2] or one can obtain a path to a uniquely-named temporary file using the <templatestyles src="Mono/styles.css" />GetTempFileName function.[3] Originally, the default was <templatestyles src="Mono/styles.css" />C:\Temp, then <templatestyles src="Mono/styles.css" />%WinDir%\Temp. In the Windows XP era, the temporary directory was set per-user as <templatestyles src="Mono/styles.css" />Local Settings\Temp, although still user-relocatable. For Windows Vista, 7, 8, and 10 the temp location has moved again to within the AppData section of the User Profile, typically <templatestyles src="Mono/styles.css" />C:\Users\User Name<templatestyles src="Mono/styles.css" />\AppData\Local\Temp (<templatestyles src="Mono/styles.css" />%USERPROFILE%\AppData\Local\Temp). In all versions of Windows, the Temp location can be accessed, for example, in Explorer, "Run..." boxes and in an application's internal code by using <templatestyles src="Mono/styles.css" />%TMP% or <templatestyles src="Mono/styles.css" />%TEMP%. As with other environmental variables, <templatestyles src="Mono/styles.css" />%TMP% or <templatestyles src="Mono/styles.css" />%TEMP% is synonymous with the full path.

In Unix and Linux, the global temporary directories are <templatestyles src="Mono/styles.css" />/tmp and <templatestyles src="Mono/styles.css" />/var/tmp. Web browsers periodically write data to the tmp directory during page views and downloads. Typically, <templatestyles src="Mono/styles.css" />/var/tmp is for persistent files (as it may be preserved over reboots), and <templatestyles src="Mono/styles.css" />/tmp is for more temporary files. See Filesystem Hierarchy Standard.[4][5] In addition, a user can set their TMPDIR environment variable to point to a preferred directory (where the creation and modification of files is allowed).

In macOS, a sandboxed application cannot use the standard Unix locations, but may use a user-specific directory whose path is provided by the function <templatestyles src="Mono/styles.css" />NSTemporaryDirectory.[6]

In OpenVMS, <templatestyles src="Mono/styles.css" />SYS$SCRATCH[7] and in AmigaDOS <templatestyles src="Mono/styles.css" />T: are used.

See also

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".

Template:Computer files