Temporary Folder
   HOME

TheInfoList



OR:

In computing, a temporary folder or temporary directory is a directory used to hold
temporary file A temporary file is a file created to store information temporarily, either for a program's intermediate use or for transfer to a permanent file when complete. It may be created by computer programs for a variety of purposes, such as when a progra ...
s. Many
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s and some
software Software consists of computer programs that instruct the Execution (computing), execution of a computer. Software also includes design documents and specifications. The history of software is closely tied to the development of digital comput ...
automatically delete the contents of this directory at bootup or at regular intervals, leaving the directory itself intact. For
security Security is protection from, or resilience against, potential harm (or other unwanted coercion). Beneficiaries (technically referents) of security may be persons and social groups, objects and institutions, ecosystems, or any other entity or ...
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 An IT administrator, system administrator, sysadmin, or admin is a person who is responsible for the upkeep, configuration, and reliable operation of computer systems, especially multi-user computers, such as servers. The system administr ...
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 Disk partitioning or disk slicing is the creation of one or more regions on Computer data storage#Secondary storage, secondary storage, so that each region can be managed separately. These regions are called partitions. It is typically the first ...
. In systems with magnetic
hard disk drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating hard disk drive platter, pla ...
s, performance (overall system
IOPS Input/output operations per second (IOPS, pronounced ''eye-ops'') is an input/output performance measurement used to characterize computer storage devices like hard disk drives (HDD), solid state drives (SSD), and storage area networks (SAN). Lik ...
) 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 disk A RAM drive (also called a RAM disk) is a block of random-access memory ( primary storage or volatile memory) that a computer's software is treating as if the memory were a disk drive (secondary storage). RAM drives provide high-performance te ...
s" set up in
random-access memory Random-access memory (RAM; ) is a form of Computer memory, electronic computer memory that can be read and changed in any order, typically used to store working Data (computing), data and machine code. A random-access memory device allows ...
or the shared-memory device in Linux. A Flash-based
solid-state drive A solid-state drive (SSD) is a type of solid-state storage device that uses integrated circuits to store data persistently. It is sometimes called semiconductor storage device, solid-state device, or solid-state disk. SSDs rely on non- ...
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 MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
and
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
, the temporary directory is set by the
environment variable An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the va ...
or . Using the Window API, one can find the path to the temporary directory using the function, or one can obtain a path to a uniquely-named temporary file using the function. Originally, the default was , then . In the Windows XP era, the temporary directory was set per-user as , 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 User Name (). 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 or . As with other environmental variables, or is synonymous with the full path. In
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, the global temporary directories are and .
Web browsers A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scree ...
periodically write data to the tmp directory during page views and downloads. Typically, is for persistent files (as it may be preserved over reboots), and is for more temporary files. See
Filesystem Hierarchy Standard The Filesystem Hierarchy Standard (FHS) is a reference describing the conventions used for the layout of Unix-like systems. It has been made popular by its use in Linux distributions, but it is used by other Unix-like systems as well. It is main ...
. In addition, a user can set their TMPDIR
environment variable An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the va ...
to point to a preferred directory (where the creation and modification of files is allowed). In
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
, a sandboxed application cannot use the standard Unix locations, but may use a user-specific directory whose path is provided by the function . In
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Op ...
, and in
AmigaDOS AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file Redirection (computing), redirection. In AmigaOS 1.x, AmigaDOS is based on a TRIPOS port by ...
are used.


See also

*
Temporary file A temporary file is a file created to store information temporarily, either for a program's intermediate use or for transfer to a permanent file when complete. It may be created by computer programs for a variety of purposes, such as when a progra ...
* Temporary variable * tmpfs *
Trash (computing) In computing, the trash, also known by other names such as trash bin, dustbin, wastebasket, and similar names, is a graphical user interface desktop metaphor for temporary storage for computer file, files set aside by the user for deletion, but ...


References

{{DEFAULTSORT:Temporary folder Computer file systems File system directories