note 22064 added to function.rmdir
| From: | alex at netflex dot nl | Date: | Wed, 05 Jun 2002 12:12:47 +0000 |
| Subject: | note 22064 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31484@lists.php.net to get a copy of this message | ||
Small change to the function of crotalus@hem.passagen.se
To work with win32
function force_rmdirs($dir) {
$dh = opendir($dir);
while(false !== ($file = readdir($dh))) {
if($file != '.' && $file != '..') {
$path = $dir.'/'.$file;
if(is_dir($path)) force_rmdirs($path);
else unlink($path);
}
}
closedir($dh ); // this line is added
return rmdir($dir);
}
--
http://www.php.net/manual/en/function.rmdir.php
http://master.php.net/manage/user-notes.php?action=edit+22064
http://master.php.net/manage/user-notes.php?action=delete+22064
http://master.php.net/manage/user-notes.php?action=reject+22064