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

2008-08-22 Thread Henrik Bengtsson
I don't know what save() "should" do - your use case is quite special - but I agree it would be better if save() tests for the existence of all object(s) to be saved before opening the connection (and thereby overwrite the existing file). A workaround for you is to do: dummy <- a; save(a, file="a

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

2008-08-22 Thread timhesterberg
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