$TemporaryDirectory

$TemporaryDirectory
gives the main system directory for temporary files on your computer system.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Show the path for the temporary directory:

In[1]:=
Click for copyable input
Out[1]=

Open a stream for writing in the temporary directory:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input

Close the stream:

In[4]:=
Click for copyable input
Out[4]=

Print the resulting file:

New in 7
New to Mathematica? Find your learning path »
Have a question? Ask support »