<s>
A	O
temporary	B-Application
file	I-Application
is	O
a	O
file	O
created	O
to	O
store	O
information	O
temporarily	O
,	O
either	O
for	O
a	O
program	O
's	O
intermediate	O
use	O
or	O
for	O
transfer	O
to	O
a	O
permanent	O
file	O
when	O
complete	O
.	O
</s>
<s>
It	O
may	O
be	O
created	O
by	O
computer	B-Application
programs	I-Application
for	O
a	O
variety	O
of	O
purposes	O
,	O
such	O
as	O
when	O
a	O
program	O
cannot	O
allocate	O
enough	O
memory	O
for	O
its	O
tasks	O
,	O
when	O
the	O
program	O
is	O
working	O
on	O
data	O
bigger	O
than	O
the	O
architecture	O
's	O
address	B-General_Concept
space	I-General_Concept
,	O
or	O
as	O
a	O
primitive	O
form	O
of	O
inter-process	B-Operating_System
communication	I-Operating_System
.	O
</s>
<s>
Modern	O
operating	B-General_Concept
systems	I-General_Concept
employ	O
virtual	B-Architecture
memory	I-Architecture
,	O
however	O
programs	O
that	O
use	O
large	O
amounts	O
of	O
data	O
(	O
e.g.	O
</s>
<s>
Most	O
operating	B-General_Concept
systems	I-General_Concept
offer	O
primitives	O
such	O
as	O
pipes	B-Operating_System
,	O
sockets	B-Protocol
or	O
shared	B-Operating_System
memory	I-Operating_System
to	O
pass	O
data	O
among	O
programs	O
,	O
but	O
often	O
the	O
simplest	O
way	O
(	O
especially	O
for	O
programs	O
that	O
follow	O
the	B-Operating_System
Unix	I-Operating_System
philosophy	I-Operating_System
)	O
is	O
to	O
write	O
data	O
into	O
a	O
temporary	B-Application
file	I-Application
and	O
inform	O
the	O
receiving	O
program	O
of	O
the	O
location	O
of	O
the	O
temporary	B-Application
file	I-Application
.	O
</s>
<s>
Operating	B-General_Concept
systems	I-General_Concept
and	O
programming	O
languages	O
typically	O
provide	O
functions	O
for	O
obtaining	O
unique	O
temporary	B-Application
file	I-Application
names	O
.	O
</s>
<s>
On	O
POSIX	O
systems	O
,	O
temporary	B-Application
files	I-Application
can	O
be	O
safely	O
created	O
with	O
the	O
mkstemp	B-Language
or	O
library	O
functions	O
.	O
</s>
<s>
These	O
files	O
are	O
typically	O
located	O
in	O
the	O
standard	O
temporary	B-Application
directory	I-Application
,	O
/tmp	O
on	O
Unix	O
machines	O
or	O
%TEMP%	O
(	O
which	O
is	O
log-in	O
specific	O
)	O
on	O
Windows	O
machines	O
.	O
</s>
<s>
A	O
temporary	B-Application
file	I-Application
created	O
with	O
is	O
deleted	O
automatically	O
when	O
the	O
program	O
exits	O
or	O
the	O
file	O
is	O
closed	O
.	O
</s>
<s>
To	O
generate	O
a	O
temporary	B-Application
file	I-Application
name	O
that	O
will	O
survive	O
past	O
the	O
lifespan	O
of	O
the	O
creating	O
program	O
,	O
(	O
POSIX	O
)	O
or	O
GetTempFileName( 	O
...	O
)	O
(	O
Windows	O
)	O
can	O
be	O
used	O
.	O
</s>
<s>
Some	O
programs	O
create	O
temporary	B-Application
files	I-Application
and	O
then	O
leave	O
them	O
behind	O
-	O
they	O
do	O
not	O
delete	O
them	O
.	O
</s>
<s>
This	O
can	O
happen	O
because	O
the	O
program	O
crashed	B-General_Concept
or	O
the	O
developer	O
of	O
the	O
program	O
simply	O
forgot	O
to	O
add	O
the	O
code	O
needed	O
to	O
delete	O
the	O
temporary	B-Application
files	I-Application
after	O
the	O
program	O
is	O
done	O
with	O
them	O
.	O
</s>
<s>
The	O
temporary	B-Application
files	I-Application
left	O
behind	O
can	O
accumulate	O
over	O
time	O
and	O
consume	O
a	O
lot	O
of	O
disk	O
space	O
.	O
</s>
<s>
Temporary	B-Application
files	I-Application
may	O
be	O
deleted	O
manually	O
.	O
</s>
<s>
Operating	B-General_Concept
systems	I-General_Concept
may	O
clear	O
out	O
the	O
temporary	B-Application
directory	I-Application
on	O
a	O
reboot	O
,	O
and	O
they	O
may	O
have	O
"	O
cleaner	O
"	O
scripts	O
that	O
remove	O
files	O
if	O
they	O
have	O
not	O
been	O
accessed	O
in	O
a	O
certain	O
amount	O
of	O
time	O
.	O
</s>
<s>
Also	O
,	O
memory-based	O
filesystems	O
,	O
such	O
as	O
tmpfs	B-Application
,	O
inherently	O
do	O
not	O
preserve	O
files	O
across	O
a	O
reboot	O
.	O
</s>
