Re: [Rd] file.copy(from=Directory, to=File) oddity

2018-04-09 Thread Tomas Kalibera
Thanks for the report, fixed in R-devel. Now we get a warning when copying a directory over a non-directory file is attempted. The target (non-directory) file is left alone. Tomas On 09/08/2017 06:54 PM, William Dunlap via R-devel wrote: When I mistakenly use file.copy() with a directory for

Re: [Rd] file.copy(from=Directory, to=File) oddity

2017-09-11 Thread William Dunlap via R-devel
Bug 17337. Note that I get R making the zero-length file on both Windows and Linux, but the return values are different. Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Sep 11, 2017 at 7:01 AM, Martin Maechler wrote: > > William Dunlap via R-devel > > on Fri, 8 Sep 2017 09:54

Re: [Rd] file.copy(from=Directory, to=File) oddity

2017-09-11 Thread Martin Maechler
> William Dunlap via R-devel > on Fri, 8 Sep 2017 09:54:58 -0700 writes: > When I mistakenly use file.copy() with a directory for the 'from' argument > and a non-directory for the 'to' and overwrite=TRUE, file.copy returns > FALSE, meaning it could not do the copying. How

[Rd] file.copy(from=Directory, to=File) oddity

2017-09-08 Thread William Dunlap via R-devel
When I mistakenly use file.copy() with a directory for the 'from' argument and a non-directory for the 'to' and overwrite=TRUE, file.copy returns FALSE, meaning it could not do the copying. However, it also replaces the 'to' file with a zero-length file. dir.create( fromDir <- tempfile() ) cat(fi

Re: [Rd] file.copy(src, src, recursive=TRUE) causes a segfault (Was: Re: R CMD check . segfault on re-building vignettes)

2012-04-30 Thread Henrik Bengtsson
It appears that file.copy() does not protect against the case when one copies one directory to a subdirectory of itself resulting in it trying to create and endless recursive copy of itself. REPRODUCIBLE EXAMPLE: src <- "foo" dir.create(src); file.copy(src, src, recursive=FALSE) # ok file.copy(src

Re: [Rd] file.copy

2007-01-16 Thread Henrik Bengtsson
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 <[EMAIL PROTECTED]> wrote: > Hi, > > Copying a non-existing file with file.copy creates an empty file > > > r <- file.copy("non-ex

[Rd] file.copy

2007-01-16 Thread Herve Pages
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

[Rd] file.copy() of non-existing file creates empty file

2006-07-22 Thread Henrik Bengtsson
Copying a non-existing file using file.copy() creates empty file. Example: > file.exists("non-existing-file") [1] FALSE > file.copy("non-existing-file", "new-file") > file.exits("new-file") [1] TRUE > file.info("new-file")$size [1] 0 The reason for this is that file.copy() calls file.create() wi