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

Karlo no Dabas maajas karlo at latnet.lv
Mon Jan 26 01:00:09 PST 2026


Hi!

Create an appropriate custom script and add it to the Toolbox. As an 
input, the directory name should be used.

The python command could be:

import shutil
shutil.rmtree("path_to_dir")

Any tool from the Toolbox can be used in modeler.

Best regards,
Kārlis


23.01.26 17:48, celati Laurent via QGIS-User rakstīja:
> [..]
> 
> , 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.
> [..]


More information about the QGIS-User mailing list