Temporary file: Difference between revisions
Reverted good faith edits by 103.23.134.82 (talk) (TW) |
JorgePeixoto (talk | contribs) tmpfs is a filesystem; and minor other fixes |
||
Line 3: | Line 3: | ||
== Auxiliary memory == |
== Auxiliary memory == |
||
Modern [[operating system]]s employ [[virtual memory]], however programs that use large amounts of data (e.g. [[Video software|video editing]]) may need to create temporary file(s). |
Modern [[operating system]]s employ [[virtual memory]], however programs that use large amounts of data (e.g. [[Video editing software|video editing]]) may need to create temporary file(s). |
||
== Inter-process communication == |
== Inter-process communication == |
||
Line 14: | Line 14: | ||
== Issues == |
== Issues == |
||
Some programs create temporary files and then leave them behind - they do not delete them. This can happen because the program [[crash |
Some programs create temporary files and then leave them behind - they do not delete them. This can happen because the program [[crash (computing)|crashed]] or the developer of the program simply forgot to add the code needed to delete the temporary files after the program is done with them. The temporary files left behind can accumulate over time and consume a lot of disk space. |
||
Temporary files may be deleted manually. Operating systems may clear out the temporary directory on a reboot, and they may have "cleaner" scripts that remove files if they have not been accessed in a certain amount of time. Also, memory-based |
Temporary files may be deleted manually. Operating systems may clear out the temporary directory on a reboot, and they may have "cleaner" scripts that remove files if they have not been accessed in a certain amount of time. Also, memory-based filesystems, such as [[tmpfs]], inherently do not preserve files across a reboot. |
||
==See also== |
==See also== |
Revision as of 00:58, 13 September 2020
Temporary files, or foo files (.TMP), are files created to temporarily contain information while a new file is being made.[1] It 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 memory
Modern operating systems employ virtual memory, however programs that use large amounts of data (e.g. video editing) may need to create temporary file(s).
Inter-process communication
Most operating systems offer primitives such as pipes, sockets or shared memory to pass data among programs, but often the simplest way (especially for programs that follow the Unix philosophy) is to write data into a temporary file and inform the receiving program of the location of the temporary file.
Creation
On POSIX systems, temporary files can be safely created with the mkstemp
or library functions. Some systems provide the former POSIX (now removed) program. These files are typically located in the standard temporary directory, /tmp on Unix machines or %TEMP% (which is log-in specific) on Windows machines.
A temporary file created with GetTempFileName(...)
(Windows) can be used.
Issues
Some programs create temporary files and then leave them behind - they do not delete them. This can happen because the program crashed or the developer of the program simply forgot to add the code needed to delete the temporary files after the program is done with them. The temporary files left behind can accumulate over time and consume a lot of disk space.
Temporary files may be deleted manually. Operating systems may clear out the temporary directory on a reboot, and they may have "cleaner" scripts that remove files if they have not been accessed in a certain amount of time. Also, memory-based filesystems, such as tmpfs, inherently do not preserve files across a reboot.
See also
References
- ^ "Windows Temporary Files". Microsoft Support. 7 July 2005. Archived from the original on 20 April 2010. Retrieved 20 October 2019.