Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Auxiliary memory  





2 Inter-process communication  





3 Creation  





4 Issues  





5 See also  





6 References  














Temporary file






العربية
Català
Deutsch
Español
Français

עברית
Русский
Suomi
Svenska
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Atemporary 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.[1] It may be created by computer programs for a variety of purposes, such as 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[edit]

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[edit]

Most operating systems offer primitives such as pipes, socketsorshared 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[edit]

Operating systems and programming languages typically provide functions for obtaining unique temporary file names.

OnPOSIX systems, temporary files can be safely created with the mkstemportmpfile library functions. Some systems provide the former POSIX (now removed) mktemp(1) 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 tmpfile is deleted automatically when the program exits or the file is closed. To generate a temporary file name that will survive past the lifespan of the creating program, tmpnam (POSIX) or GetTempFileName(...) (Windows) can be used.

Issues[edit]

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[edit]

References[edit]

  1. ^ "Windows Temporary Files". Microsoft Support. 7 July 2005. Archived from the original on 20 April 2010. Retrieved 20 October 2019.

Retrieved from "https://en.wikipedia.org/w/index.php?title=Temporary_file&oldid=1206967276"

Category: 
Computer file systems
Hidden categories: 
Articles with short description
Short description is different from Wikidata
Articles needing additional references from January 2021
All articles needing additional references
 



This page was last edited on 13 February 2024, at 16:23 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki