Share on Facebook Share on Twitter Email
Answers.com

Temporary file

 
Sci-Tech Dictionary: temporary file
(′tem·pə′rer·ē ′fīl)

(computer science) A file that is created during the execution of a computer program to hold interim results and is erased before the program is completed.


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
Computer Desktop Encyclopedia: temporary file
Top

A file created by an application for its own purposes. In the days of limited main memory, temporary files were the only way to store large amounts of interim data that the application was generating. Today, main memory is often used instead. Temporary files typically have a .TMP or .TEMP file extension, but any naming convention might be used.

Not Always Deleted

An application is responsible for deleting its temporary files; however, such files often remain on disk if the computer crashed, and the program was not closed properly. See temporary folder and temporary Internet files.

Download Computer Desktop Encyclopedia to your iPhone/iTouch

Wikipedia: Temporary file
Top

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 architecture's address space, or as a primitive form of inter-process communication.

Contents

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 files.

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.

Cleanup

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. In Microsoft Windows the temporary files left behind by the programs accumulate over time and can take up a lot of disk space. System utilities, called temporary file cleaners or disk cleaners, can be used to address this issue. UNIX based operating systems don't suffer from the same problem because their temporary files are wiped at boot.

Usage

The usual filename extension for temporary files is ".TMP". Temporary files are normally created in a designated temporary directory reserved for the creation of temporary files.

On POSIX systems, temporary files can be safely created with the mkstemp(3) or tmpfile(3) library functions, or with the 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.

Usually a temporary file 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(3) or GetTempFileName(...) (Windows only) can be used.

See also


Shopping: Temporary file
Top
 
 

 

Copyrights:

Sci-Tech Dictionary. McGraw-Hill Dictionary of Scientific and Technical Terms. Copyright © 2003, 1994, 1989, 1984, 1978, 1976, 1974 by McGraw-Hill Companies, Inc. All rights reserved.  Read more
Computer Desktop Encyclopedia. THIS DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.
© 1981-2010 The Computer Language Company Inc.  All rights reserved.  Read more
Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Temporary file" Read more