Re: [Rd] file.copy

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Wed 17 Jan 2007 - 06:52:42 GMT

FYI: I reported this to r-devel on July 23, 2006:

 http://tolstoy.newcastle.edu.au/R/devel/06/07/6220.html

There was no follow up.

/Henrik

On 1/17/07, Herve Pages <hpages@fhcrc.org> wrote:
> Hi,
>
> Copying a non-existing file with file.copy creates an empty file
>
> > r <- file.copy("non-existing-file", ".")
> > r
> [1] TRUE
>
> ... and returns TRUE!
>
> Now, when used in "vectorized" mode
>
> > r <- file.copy(c("toto1", "toto2"), c("dest1", "dest2"))
> [1] FALSE FALSE
>
> file.copy looks much more reasonable, except that files "dest1"
> and "dest2" are still created (despite the fact that "toto1" and
> "toto2" don't exist).
>
> If the 'to' argument is not a dir:
>
> > r <- file.copy(c("toto3", "toto4"), ".")
> > r
> [1] TRUE TRUE
>
> !!?!?
>
> May be those are (undocumented) features, but I bet 99.9% of the users would
> expect something different...
>
> Cheers,
> H.
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Jan 17 17:56:26 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 17 Jan 2007 - 08:31:03 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.