On 14/10/19 16:44, Anna Petrášová wrote:
This is used in many scripts and should work:
https://grasswiki.osgeo.org/wiki/GRASS_Python_Scripting_Library#Sophisticated_cleanup_procedure

Not sure this works on a Ctrl-C. ISTR it doesn't, but this would have to be verified.

Moritz


On Mon, Oct 14, 2019 at 10:00 AM Markus Neteler <nete...@osgeo.org <mailto:nete...@osgeo.org>> wrote:

    Hi,

    in the GRASS GIS 6 shell scripts we used this code to clean up temp
    files upon CTRL-C signal:

    cleanup()
    {
        g.message -v "Cleaning up ..."
        cd "$MSET_DIR"
        rm -rf "$TMP_DIR"
    }
    #### trap ctrl-c so that we can clean up tmp
    trap 'cleanup' 2 3 15

    If there anything similar we could add to the python scripts?

    thanks
    Markus
    _______________________________________________
    grass-dev mailing list
    grass-dev@lists.osgeo.org <mailto:grass-dev@lists.osgeo.org>
    https://lists.osgeo.org/mailman/listinfo/grass-dev


_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev



_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to