Temporary folder
Encyclopedia
In computing, a temporary folder or temporary directory is a directory
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

 used to hold temporary file
Temporary file
Temporary files may be created by computer programs for a variety of purposes; principally when a program cannot allocate enough memory for its tasks, when the program is working on data bigger than the architecture's address space, or as a primitive form of inter-process communication.- Auxiliary...

s. Many operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s and some software automatically delete the contents of this directory at bootup
Booting
In computing, booting is a process that begins when a user turns on a computer system and prepares the computer to perform its normal operations. On modern computers, this typically involves loading and starting an operating system. The boot sequence is the initial set of operations that the...

 or at regular intervals.

For security
Computer security
Computer security is a branch of computer technology known as information security as applied to computers and networks. The objective of computer security includes protection of information and property from theft, corruption, or natural disaster, while allowing the information and property to...

 reasons, it is best for each user
User (computing)
A user is an agent, either a human agent or software agent, who uses a computer or network service. A user often has a user account and is identified by a username , screen name , nickname , or handle, which is derived from the identical Citizen's Band radio term.Users are...

 to have their own temporary directory, since there has been a history of security vulnerabilities
Vulnerability (computing)
In computer security, a vulnerability is a weakness which allows an attacker to reduce a system's information assurance.Vulnerability is the intersection of three elements: a system susceptibility or flaw, attacker access to the flaw, and attacker capability to exploit the flaw...

 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.

Traditional locations

In MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

 and Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, the temporary directory is set by the environment variable
Environment variable
Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.They can be said in some sense to create the operating environment in which a process runs...

 TEMP. Originally, the default was c:\Temp, then %Windows%\Temp. In modern versions, the temporary directory is set per-user as Local Settings\Temp, although it is still user-relocatable.

In Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 and Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, the global temporary directories are /tmp and /var/tmp. Websites periodically write data to the tmp directory during page views and downloads. Typically, /var/tmp is for persistent files (as it may be preserved over reboots), and /tmp is for more temporary files. See Filesystem Hierarchy Standard
Filesystem Hierarchy Standard
The Filesystem Hierarchy Standard defines the main directories and their contents in Linux operating systems. For the most part, it is a formalization and extension of the traditional BSD filesystem hierarchy....

. In addition, a user can set their TMPDIR
TMPDIR
TMPDIR is the canonical Unix environment variable 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 /tmp or /var/tmp.Other forms...

 environment variable
Environment variable
Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.They can be said in some sense to create the operating environment in which a process runs...

 to point to a preferred directory (where the creation and modification of files is allowed).

Practical issues

In Unix, the /tmp directory will often be a separate disk partition
Disk partitioning
Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks. Partitions are also termed "slices" for operating systems based on BSD, Solaris or GNU Hurd...

. In systems with magnetic hard disk drives, performance (overall system IOPS
IOPS
IOPS is a common performance measurement used to benchmark computer storage devices like hard disk drives , solid state drives , and storage area networks...

) 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
Random-access memory
Random access memory is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order with a worst case performance of constant time. Strictly speaking, modern types of DRAM are therefore not random access, as data is read in...

 or the shared-memory device /dev/shm in Linux.

A Flash
Flash memory
Flash memory is a non-volatile computer storage chip that can be electrically erased and reprogrammed. It was developed from EEPROM and must be erased in fairly large blocks before these can be rewritten with new data...

-based solid-state drive
Solid-state drive
A solid-state drive , sometimes called a solid-state disk or electronic disk, is a data storage device that uses solid-state memory to store persistent data with the intention of providing access in the same manner of a traditional block i/o hard disk 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
Wear leveling
Wear leveling is a technique for prolonging the service life of some kinds of erasable computer storage media, such as Flash memory used in solid-state drives and USB Flash drives...

.)
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK