note 73067 deleted from function.rmdir by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 18 Feb 2007 02:13:25 +0000 |
| Subject: | note 73067 deleted from function.rmdir by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123526@lists.php.net to get a copy of this message | ||
Note Submitter: jjohnston at mailwise dot com
----
Regarding the shell method by noel:
Remeber that many of php's functions involving file and directory permissions / existance / etc
use cached results (stat() family functions). By calling out to a separate process with the exec
family of functions you will need to call clearstatcache(); afterwards or else is_dir() will report
erroneous results.
Found that out the hard way.
Also make sure $tmp isn't '/' or else you will end up running a
rm -rf /
which might not be good for you.
Found that out the hard way too . . .