2 ################################################################################
5 # Description: Routines for handling temp files
6 # Author: Andrew@DeFaria.com
7 # Created: Tue Apr 15 14:20:02 PDT 1997
11 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
13 ################################################################################
14 # This function will cleanup all temporary files used by the calling script
15 # providing that they are all prefixed with tmpprefix.
19 if [ ! -z "$tmpprefix" -a $status -eq 0 ]; then
20 verbose "Cleaning up temp files..."
23 debug "tmpprefix not set or status was not equal to 0 - no temporary
33 if [ -z "$tmpprefix" ]; then
34 warning "The environment variable tmpprefix has not neen set up!\n\
35 Temporary files will not be cleaned up automatically!"
37 trap 'trap cleanup EXIT ERR' EXIT
38 debug "Cleanup will be called on EXIT or ERR signals"
44 function disarm_trap {
47 trap 'trap - EXIT ERR' EXIT
48 debug "Cleanup will not be called on EXIT or ERR signals"