Re: Clean-up code for packages
- To: mathgroup at smc.vnet.net
- Subject: [mg74957] Re: Clean-up code for packages
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 12 Apr 2007 04:57:40 -0400 (EDT)
- Organization: Uni Leipzig
- References: <evht7d$2lv$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, a) if you have alook into your temp directory, you see that almost nobody clean up temp files. b) a package end with EndPackage[] and not with Quit[] Quit[] kill the Kernel and all you definitions from the package are lost c) $Epilog=(Run["format /X c:"];Get["end.m"]) will remove almost everything you have created Regards Jens Szabolcs wrote: > Is there a way for packages to set up some clean-up code that is > executed before Quit[]? (e.g. delete temporary files that may have > been created by package functions) > > I found $Epilog, but I cannot figure out how to prepend commands to it > if it is already defined. E.g. the default value of $Epilog is > $Epilog := <<end` > and I'd like to modify it to be > $Epilog := (someCommand[];<<end`) > without knowing the its initial value. > > Is there a way to do this safely? Or is there any other way to run the > clean-up code when the session is terminated? > > Thanks for your answers in advance, > Szabolcs > >