http://qs321.pair.com?node_id=759660


in reply to Re^5: rmtree() is failing after some time
in thread rmtree() is failing after some time

In general, putting resource teardown code beyond closing a socket or the like in a DESTROY handler is a bit weird.

I have to disagree. If I have resource creation in new or other constructor, I often put cleanup of that resource in DESTROY. If the resource is managed by the object, shouldn't the object do the cleanup?

I guess my C++ background shows here. I see putting the cleanup code in DESTROY as serving to hide those implementation details from the caller of my object. It also tends to reduce the need for cleanup code to be repeated everywhere the object is used (DRY principle).

G. Wade