<div dir="ltr"><div>Dear all,</div><div>Following my previous question,  a<span class="gmail-HwtZe" lang="en"><span class="gmail-jCAhz gmail-ChMk0b"><span class="gmail-ryNqvb">fter some testing, although I've enabled the option in QGIS </span></span></span>
<b>"Enable overwrite:</b> Processing -> Options -> General -> <b>Overwrite existing files"</b> )<br><span class="gmail-HwtZe" lang="en"><span class="gmail-jCAhz gmail-ChMk0b"><span class="gmail-ryNqvb"><br>, it seems that all the contents of the 'intermediate' folder aren't really being deleted.</span></span> <span class="gmail-jCAhz gmail-ChMk0b"><span class="gmail-ryNqvb">This is causing problems when re-running the modeler (new settings aren't always being applied to the new version).</span></span> <span class="gmail-jCAhz gmail-ChMk0b"><span class="gmail-ryNqvb">I can't find a tool within the modele that would delete files/folders.</span></span><span class="gmail-jCAhz gmail-ChMk0b"><span class="gmail-ryNqvb">
So, unless I'm mistaken, it seems the only solution would be to add a small script at the beginning of the modeler's process that would force the deletion of all the folder's contents for the 'intermediate folder: all existing files and all folders as well.</span></span> <span class="gmail-jCAhz gmail-ChMk0b"><span class="gmail-ryNqvb">Does anyone think they could point me towards such a script?</span></span> <span class="gmail-jCAhz gmail-JpY6Fd"><span class="gmail-ryNqvb">Many thanks.</span></span></span>

</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Le mar. 13 janv. 2026 à 15:13, celati Laurent <<a href="mailto:laurent.celati@gmail.com">laurent.celati@gmail.com</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"><div dir="ltr"><div dir="ltr"><div>Hello,</div><div>Thanks so much for your reply. I have just done several tests following your recommandation. Indeed,  <b>"Enable overwrite:</b> Processing -> Options -> General -> <b>Overwrite existing files" </b>seems to work and to be enough for my use case.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 12 janv. 2026 à 20:32, <a href="mailto:vukovicvl@fiberq.net" target="_blank">vukovicvl@fiberq.net</a> <a href="mailto:vukovicvl@fiberq.net" target="_blank">vukovicvl@fiberq.net</a> <<a href="mailto:vukovicvl@fiberq.net" target="_blank">vukovicvl@fiberq.net</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"><u></u>

  
   
 
 <div>
  <div>
   Hi celati,
  </div> 
  <div>
    
  </div> 
  <div> 
   <div>
    QGIS Modeler doesn’t really have a built-in “clean intermediate outputs on rerun” option. The usual workarounds are:
   </div> 
   <div>
     
   </div> 
   <div>
    <b>Enable overwrite:</b> Processing -> Options -> General -> <b>Overwrite existing files</b>. For many GDAL outputs (like GeoTIFF) this is enough.
   </div> 
   <div>
     
   </div> 
   <div>
    <b>Delete first, then run:</b> Add a first step in the model that deletes the known intermediate files (if you have a delete/remove tool available in your Processing toolbox - often under GDAL). Since your filenames are fixed, it’s straightforward.
   </div> 
   <div>
     
   </div> 
   <div>
    If you don’t have any delete tool available in Modeler, the reliable fallback is running the model from a small script that deletes the <i>intermediate</i> folder contents before launching the model.
   </div> 
   <div>
     
   </div> 
   <div>
    I hope this helps.
   </div> 
   <div>
     
   </div> 
  </div> 
  <blockquote type="cite"> 
   <div>
    On 01/12/2026 7:05 PM CET celati Laurent via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a>> wrote:
   </div> 
   <div>
     
   </div> 
   <div>
     
   </div> 
   <div dir="ltr"> 
    <div> 
     <div>
       
     </div> 
    </div> 
    <div> 
     <div> 
      <pre><code>Dear all,</code></pre> 
     </div> 
    </div> 
    <div> 
     <div>
       
     </div> 
    </div> 
    <div> 
     <div> 
      <p>I'm working with QGIS 3.40.</p> 
      <p>I've set up a small QGIS modeler with several inputs, algorithms, intermediate outputs, and a final result (model output). For the intermediate algorithm outputs, I've defined a "pre-calculated value" with a relative path.</p> 
      <p>Here 's the expression setted :</p> 
      <blockquote>
       <code>@project_home || '/intermediaire' || '/segmentation_raster' || '.tif' </code>
      </blockquote> 
     </div> 
    </div> 
    <div>
      
    </div> 
    <div> 
     <p>All my intermediate outputs are stored in a folder named "intermediate". Each output file has a predefined name and extension.</p> 
     <p>This works. However, I would like these 'intermediate' files to be automatically deleted/overwritten each time the modeler is run again (delete/replace the output files from the previous run).</p> Could you give me some guidances, provide some ways to do that ? Thanks so much.
    </div> 
   </div> _______________________________________________
   <br>QGIS-User mailing list
   <br><a href="mailto:QGIS-User@lists.osgeo.org" target="_blank">QGIS-User@lists.osgeo.org</a>
   <br>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
   <br>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
  </blockquote> 
  <div>
    
  </div> 
  <div> 
   <table style="font-family:Arial,Helvetica,sans-serif;font-size:13px;color:rgb(17,17,17);line-height:1.35" cellspacing="0" cellpadding="0"> 
    <tbody> 
     <tr> 
      <td style="padding:0px 14px 0px 0px;vertical-align:top"><img style="display: block; border: 0px; outline: none; text-decoration: none;" src="https://www.fiberq.net/wp-content/uploads/2025/12/fiberq_logo_transparent.png" alt="FiberQ" width="172" height="57"></td> 
      <td style="vertical-align:top;padding-top:2px"> 
       <div style="font-size:14px;font-weight:bold">
        Vladimir Vuković
       </div> 
       <div style="font-size:13px">
        Author of FiberQ
       </div> 
       <div style="height:8px">
         
       </div> 
       <div>
        <a style="color:rgb(17,17,17);text-decoration:none" href="mailto:vukovicvl@fiberq.net" target="_blank">vukovicvl@fiberq.net</a> 
        <br><a style="color:rgb(17,17,17);text-decoration:none" href="https://fiberq.net" target="_blank">fiberq.net</a> 
        <br><a style="color:rgb(17,17,17);text-decoration:none" href="tel:+381604262012" target="_blank">+381 60 426 2012</a>
       </div> </td> 
     </tr> 
    </tbody> 
   </table> 
  </div>
 </div>
</blockquote></div></div>
</blockquote></div>