From joehl at web.de  Sun Nov 15 15:35:12 2009
From: joehl at web.de (joehl at web.de)
Date: Sun, 15 Nov 2009 15:35:12 +0100 (CET)
Subject: [Rd] file.rename overwrites existing target (PR#14065)
Message-ID: <20091115143512.B31ED2830314@mail.pubhealth.ku.dk>

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)



[Rd] file.rename overwrites existing target (PR#14065)
joehl at web.de