[Pythonmac-SIG] Finder Crash, after moving files....

John W. Baxter jwblist at olympus.net
Mon Jul 5 22:17:22 CEST 2004


On 7/5/2004 10:46, "has" <hengist.podd at virgin.net> wrote:

> Bob Ippolito wrote:
> 
>>>> Have you tried using shutil.move instead?  It's probably a whole heck
>>>> of a lot faster anyway (though there's a chance it might not preserve
>>>> resource forks).
>>> 
>>> shutil.__doc__ says it doesn't. Consider using ditto instead.
>> 
>> If it's on the same volume, it will rename and that should preserve the
>> resource fork.  In the copy case, it's probably MUCH MUCH less painful
>> to just change the implementation to also copy resource forks than it
>> is to spawn ditto and have it copy regardless of destination volume.
>> Thousands and thousands of useless copies isn't a good thing to do if
>> you don't need to, because it's really slow and it makes it a whole
>> heck of a lot more likely that you will run out of disk space during
>> the operation.
> 
> Just quoting the shutil docs. :) While ditto+rm are slow, they will
> do the job. But yeah, I agree that patching shutil to handle Mac
> files correctly in all cases would be the best [long-term] solution.
> (It'd also allow findertools to be dropped; no bad thing.)

It seems to me that I remember that
"cp is modified to preserve resource forks [in Tiger]" emerged from WWDC.
If cp is modified, that fixes mv (which uses cp when it needs to copy).

Given that (if I am correct), I think I would use ditto pre-Tiger, and mv
starting with Tiger.

  --John


More information about the Pythonmac-SIG mailing list