From b.rowlingson at lancaster.ac.uk  Fri Jun  5 22:52:13 2009
From: b.rowlingson at lancaster.ac.uk (Barry Rowlingson)
Date: Fri, 5 Jun 2009 21:52:13 +0100
Subject: [Rd] Show location of workspace image on quit?
In-Reply-To: <971536df0906050902g5ace0a74pe45c7d290447e05e@mail.gmail.com>
References: <d8ad40b50906050453q5ae944e2v18cf12093e397ed1@mail.gmail.com>
	<4A290C16.40102@stats.uwo.ca> <4A29115B.8060405@idi.ntnu.no>
	<1244205963.3903.4.camel@ubuntu> <4A292108.1020705@idi.ntnu.no>
	<971536df0906050701x3cb8bc81vb3930d27f9c96ff1@mail.gmail.com>
	<d8ad40b50906050852y310639eblbe1fe12424735cc9@mail.gmail.com>
	<971536df0906050902g5ace0a74pe45c7d290447e05e@mail.gmail.com>
Message-ID: <d8ad40b50906051352r392b0ce9s460464d182a042f6@mail.gmail.com>

Here's a replacement 'q' function that spits out the path of the
workspace image:

q = function (save = "default", status = 0, runLast = TRUE)
{
cat(paste("Workspace image is
",file.path(getwd(),formals(save.image)$file),'\n'))
flush.console()
.Internal(quit(save, status, runLast))
}

Note the trickiness for getting the file name - without diving into
internals I can't see how q() gets the filename so I'm just robbing
the default value from save.image. The flush.console makes sure the
path is printed before Windows shows the confirmation dialog. Yes it
would be nicer if the path was included on the dialog, but that's
about 100 times as much work as adding two lines to the existing q
definition.

Anyway, that does the job for me.

Barry



[Rd] Show location of workspace image on quit?
Barry Rowlingson