<div dir="ltr"><div>Thanks to you both !<br></div><div>I think that's what i was missing... <br></div><div>It works now !</div><div><br></div><div>Regards,</div><div>yann<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 2 juin 2019 à 11:51, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Jun 2, 2019 at 11:00 AM Micha Silver <<a href="mailto:tsvibar@gmail.com" target="_blank">tsvibar@gmail.com</a>> wrote:<br>
> On 6/1/19 4:43 PM, Le Jeune Yann wrote:<br>
><br>
> Hello !<br>
><br>
> I would like to delete temporary files during the process of a python script. I have look at g.tempfile but it seems I don't know how to use it in a python script.<br>
> I have tried :<br>
> PROCESS_ID = os.getpid()<br>
> ...<br>
> TEMP1 = grass.read_command ('g.tempfile',<br>
>     pid = PROCESS_ID)<br>
><br>
> But this changes nothing, after about 67200 calculations of r.viewshed no more temporary file can be created and the script stopped.<br>
><br>
><br>
> Are you manually removing the TEMP1 files within your script? I think that GRASS cleans up tempfiles only when the session exits, so with such a large number of calculations, you should manually remove them within the script.<br>
<br>
For an example, see<br>
scripts/r.in.aster/<a href="http://r.in.aster.py" rel="noreferrer" target="_blank">r.in.aster.py</a><br>
<br>
therein, this function is used:<br>
grass.try_remove(tempfile)<br>
<br>
Markus<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><br style="color:rgb(153,0,0)"><font size="1"><span style="color:rgb(102,0,0)">Yann Le Jeune</span></font><br><font size="1">Web : <a href="http://www.paleosystem.fr" target="_blank">http://www.paleosystem.fr</a></font> <font size="1"><a href="https://ello.co/yannz" target="_blank">https://ello.co/yannz</a></font><br><br></div></div></div></div></div>