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

joehl at web.de joehl at web.de
Sun Nov 15 15:35:12 CET 2009


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)



More information about the R-devel mailing list