[Qgis-user] QGIS Modeler: Automatic Deletion/Overwriting of output files (precalculated value)?

celati Laurent laurent.celati at gmail.com
Fri Jan 23 07:48:21 PST 2026


Dear all,
Following my previous question,  after some testing, although I've enabled
the option in QGIS  *"Enable overwrite:* Processing -> Options -> General
-> *Overwrite existing files"* )

, it seems that all the contents of the 'intermediate' folder aren't really
being deleted. This is causing problems when re-running the modeler (new
settings aren't always being applied to the new version). I can't find a
tool within the modele that would delete files/folders. 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. Does anyone think they could point me towards such a
script? Many thanks.

Le mar. 13 janv. 2026 à 15:13, celati Laurent <laurent.celati at gmail.com> a
écrit :

> Hello,
> Thanks so much for your reply. I have just done several tests following
> your recommandation. Indeed,  *"Enable overwrite:* Processing -> Options
> -> General -> *Overwrite existing files" *seems to work and to be enough
> for my use case.
>
> Le lun. 12 janv. 2026 à 20:32, vukovicvl at fiberq.net vukovicvl at fiberq.net <
> vukovicvl at fiberq.net> a écrit :
>
>> Hi celati,
>>
>> QGIS Modeler doesn’t really have a built-in “clean intermediate outputs
>> on rerun” option. The usual workarounds are:
>>
>> *Enable overwrite:* Processing -> Options -> General -> *Overwrite
>> existing files*. For many GDAL outputs (like GeoTIFF) this is enough.
>>
>> *Delete first, then run:* 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.
>>
>> 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
>> *intermediate* folder contents before launching the model.
>>
>> I hope this helps.
>>
>>
>> On 01/12/2026 7:05 PM CET celati Laurent via QGIS-User <
>> qgis-user at lists.osgeo.org> wrote:
>>
>>
>>
>>
>> Dear all,
>>
>>
>>
>> I'm working with QGIS 3.40.
>>
>> 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.
>>
>> Here 's the expression setted :
>>
>> @project_home || '/intermediaire' || '/segmentation_raster' || '.tif'
>>
>>
>>
>> All my intermediate outputs are stored in a folder named "intermediate".
>> Each output file has a predefined name and extension.
>>
>> 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).
>> Could you give me some guidances, provide some ways to do that ? Thanks
>> so much.
>> _______________________________________________
>> QGIS-User mailing list
>> QGIS-User at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>> [image: FiberQ]
>> Vladimir Vuković
>> Author of FiberQ
>>
>> vukovicvl at fiberq.net
>> fiberq.net
>> +381 60 426 2012 <+381604262012>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20260123/7afbf19c/attachment-0001.htm>


More information about the QGIS-User mailing list