<chapter><title>Temporary files</title>
<sect1><title>Introduction</title>
<para>
<command>GDMS</command> needs to be able to store information in temporary files to operate 
correctly. The information currently stored in temporary files are the graphs used in the 
user interface, and active datasets. This is done to avoid the graphs having to be 
regenerated each time they are drawn. This technique also serves to avoid having images 
cached in memory, which could result in a large amount of memory being used for data that
is not frequently accessed.
</para>

<para>
The <command>GDMS</command> determines when the files in the temporary graph cache are out of date. When this occurs,
the graphs are regenerated as required.
</para>
</sect1>

<sect1><title>Location of temporary files</title>
<para>
Temporary files are stored by default in <emphasis>/tmp</emphasis>.
</para>

<para>
The files have randomly generated names which match the regular expression <emphasis>cep.*$</emphasis>. Examples of
valid temporary filenames are:
</para>

<programlisting>
cep.5tgSBw
cep.7v2DRn
cep.AxSGaC
cep.d4j1at
cep.dinwwj
cep.eu4OqI
cep.HDxyXc
cep.I6U6DO
cep.k2Wweg
cep.pDpvqC
cep.qcRKds
cep.sBiOhb
cep.VqHGbW
cep.YoTRdk
cep.zbOzJ3
</programlisting>

<para>
These files can amount to a non-trivial amount of space on disk. The example files
totalled 808 kilobytes.
</para>
</sect1>

<sect1><title>Cleanup of temporary files</title>
<para>
The <command>GDMS</command> will automatically cleanup temporary files as required. In
practise, this means that temporary files from previous sessions are deleted when
the<command>GDMS</command> is run. Note that only the GUI implementation cleans the
<emphasis>/tmp</emphasis> directory. The <command>GDMS web</command> does not perform
this operation as it does not create it's temporary files in this manner. For further
information refer to the <command>GDMS web</command> documentation.
</para>

<para>
One limitation which this approach imposes is that is that it restricts the number of
concurrent sessions to one on any single machine. The problem is that starting a new
session will result in an attempt to clean any files generated by other sessions. The
caches are only used during processing and are discarded, however the race condition
exists and could cause problems.
</para>
</sect1>
</chapter>
