On Mar 1, 2010, at 00:32 , Nick Sabalausky wrote:

> Turns out there's a bug in that, but I can't figure out why...
> 
> Consider this part:
> 
> ----------------------------
> def copy_entryx(src, dest, filter, preserve = false, dereference_root = 
> false, remove_destination = false)
>  Entry_.new(src, nil, dereference_root).traverse do |ent|
>    if filter.call(ent.path) then
>      destent = Entry_.new(dest, ent.rel, false)
>      File.unlink destent.path if remove_destination && 
> File.file?(destent.path)
>      ent.copy destent.path
>      ent.copy_metadata destent.path if preserve
>    end
>  end
> end
> ----------------------------
> 
> [...]
> 
> Why does it do that, and how can I fix it?

I have no idea because there is no test to look at that reproduces this problem. So, write a failing test and make it work. This would be especially easy if you refactored that File.unlink to be a method of Entry_ (don't name it that. ugh!).