From: Paul on
> So the error sounds, to me, as if the code is changing directories as
> it is deleting things, and sometimes, the path being deleted is where
> the program is located.

No, it's in a different location. Besides, that kind of problem would
not have been intermittent. I can run exactly the same command in the
same place twice, and it will fail the first time and succeed the
second time...