From murdoch at stats.uwo.ca  Thu Oct 30 21:07:34 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu, 30 Oct 2008 16:07:34 -0400
Subject: [Rd] Small modification of zip.file.extract in utils?
In-Reply-To: <490A062B.3010906@geo.uu.nl>
References: <490A062B.3010906@geo.uu.nl>
Message-ID: <490A1406.7030507@stats.uwo.ca>

On 10/30/2008 3:08 PM, Jon Olav Skoien wrote:
> Dear list,
> 
> I needed to extract a zip-archive, and found zip.file.extract in utils. 
> My only problem was the use of tempdir(), since I wanted to permanently 
> extract the archive at a fixed location for later use. My own fix was 
> simple, adding an extra parameter zipdir (without default), and within 
> the function change
> tmpd <- tempdir()
> to
> tmpd = ifelse(missing(zipdir),tempdir(),zipdir)
> 
> This modification could maybe be useful also for other users, unless 
> there are some problems I am not aware of?

I won't comment on the value of the extra parameter, but the 
implementation would be simpler if you set the default for zipdir to 
tempdir(), and then just used zipdir in place of tmpd throughout.

Duncan Murdoch



[Rd] Small modification of zip.file.extract in utils?
Duncan Murdoch