[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

Re: FileUtils.mv does not unlink source file when moving over filesystem boundary

From: ara.t.howard@...
Date: 2006-01-16 16:50:52 UTC
List: ruby-core #7166
On Mon, 16 Jan 2006, Pav Lucistnik wrote:

> Hi,
>
> I found a bug in ruby 1.8.4 in FileUtils.mv() function. When moving a
> file from one filesystem to another, it does not unlink the source file.
> Ruby 1.8.2 worked fine.
>
> Patch against 1.8.4 release:
>
> --- lib/fileutils.rb.orig	Sun Nov 20 02:23:41 2005
> +++ lib/fileutils.rb	Mon Jan 16 02:08:47 2006
> @@ -501,6 +501,7 @@
>           File.rename s, d
>         rescue Errno::EXDEV
>           copy_entry s, d, true
> +          File.unlink s
>         end
>       rescue SystemCallError

eeks!  this is terrible even with the fix.  emulating mv with copy will
undoubtedly blows up certain codes that assume files in a directory are not
actively being written to.  at minimum this code should do something like

   ...

   def transfer_entry s, d, hidden = true, ext = "tmp"
     dirname, basename = File.split d
     tmp = File.join dirname, "#{ '.' if hidden }#{ basename }.#{ ext }"
     copy_entry s, tmp, true
     File.rename tmp, d
   end

   ...

       File.rename s, d
     rescue Errno::EXDEV
       transfer_entry s, d
       File.unlink s
     end
   rescue SystemCallError

   ...



to emulate mv with copy really is shocking.

regards.


-a
-- 
strong and healthy, who thinks of sickness until it strikes like lightning?
preoccupied with the world, who thinks of death, until it arrives like
thunder?  -- milarepa


In This Thread