I dont know for sure but it would seem that you are calling rmtree() incorrectly. You are doing
rmtree("/tmp/tempdir",0,1);
But the docs say
NOTE: If the third parameter is not TRUE, rmtree is unsecure in the face of failure or interruption. Files and directories which were not deleted may be left with permissions reset to allow world read and write access. Note also that the occurrence of errors in rmtree can be determined only by trapping diagnostic messages using $SIG{__WARN__}; it is not apparent from the return value. Therefore, you must be extremely careful about using rmtree($foo,$bar,0) in situations where security is an issue.
Which suggests to me that your problem is because the third parameter is TRUE where it should really be FALSE.
Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.