EVOLUTION-MANAGER
Edit File: rasterTmpFile.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Temporary files</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for rasterTmpFile {raster}"><tr><td>rasterTmpFile {raster}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Temporary files</h2> <h3>Description</h3> <p>Functions in the raster package create temporary files if the values of an output Raster* object cannot be stored in memory (RAM). This can happen when no filename is provided to a function and in functions where you cannot provide a filename (e.g. when using 'raster algebra'). </p> <p>Temporary files are automatically removed at the start of each session. During a session you can use <code>showTmpFiles</code> to see what is there and <code>removeTmpFiles</code> to delete all the temporary files. <code>rasterTmpFile</code> returns a temporary filename. These can be useful when developing your own functions. These filenames consist of <code>prefix_date_time_pid_rn</code> where <code>pid</code> is the process id returned by <code><a href="../../base/html/Sys.getpid.html">Sys.getpid</a></code> and <code>rn</code> is a 5 digit random number. This should make tempfiles unique if created at different times and also when created in parallel processes (different pid) that use <code><a href="../../base/html/Random.html">set.seed</a></code> and call rasterTmpFile at the same time. It is possible, however, to create overlapping names (see the examples), which is undesirable and can be avoided by setting the prefix argument. </p> <h3>Usage</h3> <pre> rasterTmpFile(prefix='r_tmp_') showTmpFiles() removeTmpFiles(h=24) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>prefix</code></td> <td> <p>Character. Prefix to the filename (which will be followed by 10 random numbers)</p> </td></tr> <tr valign="top"><td><code>h</code></td> <td> <p>Numeric. The minimum age of the files in number of hours (younger files are not deleted)</p> </td></tr> </table> <h3>Value</h3> <p><code>rasterTmpFile</code> returns a valid file name </p> <p><code>showTmpFiles</code> returns the names (.grd only) of the files in the temp directory </p> <p><code>removeTmpFiles</code> returns nothing </p> <h3>See Also</h3> <p><code><a href="rasterOptions.html">rasterOptions</a></code>, <code><a href="../../base/html/tempfile.html">tempfile</a></code> </p> <h3>Examples</h3> <pre> ## Not run: rasterTmpFile('mytemp_') showTmpFiles() removeTmpFiles(h=24) ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>raster</em> version 3.3-13 <a href="00Index.html">Index</a>]</div> </body></html>