[Rd] file.rename overwrites existing target (PR#14065)

From: <joehl_at_web.de>
Date: Sun, 15 Nov 2009 15:35:12 +0100 (CET)


Full_Name: Jens Oehlschlägel
Version: 2.10.0
OS: Windows XP Professional
Submission from: (NULL) (85.181.158.112)

file.rename() will successfully rename file a to b - even if b exists already. Though the documentation does not state what file.rename() will do in this case,
I guess the expected behaviour is to fail and return FALSE.

Kind regards

Jens Oehlschlägel

> cat("a\n", file="a.txt")
> cat("b\n", file="b.txt")
> file.rename("a.txt","b.txt")

[1] TRUE
> readLines("b.txt")

[1] "a"
> version

               _                            
platform       i386-pc-mingw32              
arch           i386                         
os             mingw32                      
system         i386, mingw32                
status                                      
major          2                            
minor          10.0                         
year           2009                         
month          10                           
day            26                           
svn rev        50208                        
language       R                            
version.string R version 2.10.0 (2009-10-26)

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 15 Nov 2009 - 14:48:46 GMT

This archive was generated by hypermail 2.2.0 : Mon 16 Nov 2009 - 00:50:25 GMT