.Last is usually not called (PR#227)
ripley@stats.ox.ac.uk
ripley@stats.ox.ac.uk
Thu, 15 Jul 1999 11:28:13 +0200 (MET DST)
R-0.64.2 and R-devel:
[I found this by looking at the code.]
A .Last function is _only_ called if the condition that causes termination
is EOF on the console or input:
> .Last <- function() cat("ran .Last\n")
> q("no")
returns to the shell.
> .Last <- function() cat("ran .Last\n")
> # I hit ^D here
ran .Last
Save workspace image? [y/n/c]: n
The problem is that .Last is handled in end_Rmainloop(), and that is
not called by q(). We need to move the handling to R_CleanUp (and
for some reason do_quit is system-dependent, so need not even call
R_CleanUp). I'll work on this.
I did check the documentation: ?quit does claim .Last should be called:
Immediately before terminating, the function `.Last()'
is executed if it exists.
Brian
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._