[Rd] save() should not overwrite a file if an error occurs (PR#12583)

timhesterberg at gmail.com timhesterberg at gmail.com
Sat Aug 23 00:45:08 CEST 2008


If save() fails because an object is not found,
it should not overwrite an existing file.

> a <- 1:9
> save(a, file = "a.rda")
> rm(a)
> load("a.rda")
> a
 [1]  1  2  3  4  5  6  7  8  9
> rm(a)
> save(a, file = "a.rda")
Error in save(a, file = "a.rda") : object 'a' not found
> load("a.rda")
Error in load("a.rda") : error reading from connection

I've been saving copies of huge objects into
files like a.rda, then removing the objects.
If I then happen to save again, I don't want to lose
my data.


--please do not edit the information below--

Version:
 platform = i486-pc-linux-gnu
 arch = i486
 os = linux-gnu
 system = i486, linux-gnu
 status =
 major = 2
 minor = 7.1
 year = 2008
 month = 06
 day = 23
 svn rev = 45970
 language = R
 version.string = R version 2.7.1 (2008-06-23)

Locale:
LC_CTYPE=en_US;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US;LC_PAPER=en_US;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:Rfixes, package:Rcode, package:aggregate,
package:stats, package:graphics, package:grDevices, package:utils,
package:datasets, package:showStructure, package:splus2R, package:methods,
Autoloads, package:base

	[[alternative HTML version deleted]]



More information about the R-devel mailing list