From ggrothendieck at gmail.com  Sun Nov 15 16:09:52 2009
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Sun, 15 Nov 2009 10:09:52 -0500
Subject: [Rd] file.rename overwrites existing target (PR#14065)
In-Reply-To: <C725E3C3.8B9F%jari.oksanen@oulu.fi>
References: <20091115143512.B31ED2830314@mail.pubhealth.ku.dk> 
	<C725E3C3.8B9F%jari.oksanen@oulu.fi>
Message-ID: <971536df0911150709n6cd3a8d8x2ca5252c9d65b79@mail.gmail.com>

On Sun, Nov 15, 2009 at 9:58 AM, Jari Oksanen <jari.oksanen at oulu.fi> wrote:
> On 15/11/09 16:35 PM, "joehl at web.de" <joehl at web.de> wrote:
>
>> 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.
>
> The *expected* behaviour is to overwrite the old file. Your expectation
> seems to be different, but overwriting or deleting the old file has been the

On UNIX the expected behavior would be to overwrite but on Windows the
rename command does not overwrite silently but fails so I think his
expectation is in line with how Windows works at the command line
level.  It might be worthwhile to have an overwrite= argument on
file.rename to control this.  If it defaulted to TRUE then the
expectation would be clear regardless of platform.



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