note 91545 deleted from function.rmdir by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 08:04:43 +0000 |
| Subject: | note 91545 deleted from function.rmdir by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196800@lists.php.net to get a copy of this message | ||
Note Submitter: maurozadu at gmail dot com
----
if you opened a dir with opendir() you must closedir() before try to execute rmdir() or you will get
a "permision denied" error on windows systems.
Wrong:
<?php
$handle = opendir($dirpath);
//do whatever you need
rmdir($dirpath);
?>
Right:
<?php
$handle = opendir($dirpath);
//do whatever you need
closedir($handle)
rmdir($dirpath);
?>