<html style="direction: ltr;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body bidimailui-charset-is-forced="true" style="direction: ltr;"
text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 07/20/2018 06:05 PM, Frank David
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:991b999e-fe8d-f7f5-6f55-3ed921022c85@geophom.fr">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<p><font size="-1">Hello dear grass users,</font></p>
<p><font size="-1">I'm writing python scripts and I wonder if is
there a better way to handle tmp file between several mapcalc,
For the moment I create a tmp raster file and once I don't
need anymore I remove with g.remove. If the script crash, the
tmp raster still exists. If another script run and use the
same tmp name, that could make conflict.</font></p>
<p><font size="-1">Is there a specific way the handle tmp raster
(or vector) file ?</font></p>
</blockquote>
<p><font size="-1">I guess the proper way to deal with this is to
first prepare a cleanup function. Then wrap your grass functions
in a try...except structure, and whenever you catch an error,
fire off the cleanup routine.</font></p>
<p><font size="-1"></font><br>
</p>
<blockquote type="cite"
cite="mid:991b999e-fe8d-f7f5-6f55-3ed921022c85@geophom.fr">
<p><font size="-1">Thank you<br>
Frank<br>
</font></p>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918</pre>
</body>
</html>