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...
>=20
> Consider this part:
>=20
> ----------------------------
> def copy_entryx(src, dest, filter, preserve =3D false, =
dereference_root =3D=20
> false, remove_destination =3D false)
>  Entry_.new(src, nil, dereference_root).traverse do |ent|
>    if filter.call(ent.path) then
>      destent =3D Entry_.new(dest, ent.rel, false)
>      File.unlink destent.path if remove_destination &&=20
> File.file?(destent.path)
>      ent.copy destent.path
>      ent.copy_metadata destent.path if preserve
>    end
>  end
> end
> ----------------------------
>=20
> [...]
>=20
> 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!).