[Rd] file.copy

Herve Pages hpages at fhcrc.org
Wed Jan 17 04:15:25 CET 2007


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.



More information about the R-devel mailing list