Re: [Rd] misfeature: forced file.copy() of a file over itself truncates the file ...

2012-01-31 Thread Ben Bolker
Ben Bolker gmail.com> writes: > Bump. Will I be scolded if I submit this as a bug report/wishlist item? Test case: > fn <- "tmp.dat" > x <- 1:3 > dump("x",file=fn) > file.info(fn) ## 9 bytes > file.copy(paste("./",fn,sep=""),fn,overwrite=TRUE) > file.info(fn) ## 0 bytes (!!)

Re: [Rd] misfeature: forced file.copy() of a file over itself truncates the file ...

2012-01-27 Thread William Dunlap
malizePath(c("usr", "/nfs/seabldlnx3201/usr", "/nfs/sea-union/usr")) [1] "/nfs/sea-union/usr" "/nfs/seabldlnx3201/usr" "/nfs/sea-union/usr" Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From

[Rd] misfeature: forced file.copy() of a file over itself truncates the file ...

2012-01-27 Thread Ben Bolker
Try this: fn <- "tmp.dat" x <- 1:3 dump("x",file=fn) file.info(fn) ## 9 bytes file.copy(paste("./",fn,sep=""),fn,overwrite=TRUE) file.info(fn) ## 0 bytes (!!) Normally file.copy() checks and disallows overwriting a file with itself, but it only checks whether character string '