note 22064 deleted from function.rmdir by spic
| From: | spic@php.net | Date: | Tue, 17 Sep 2002 11:16:24 +0000 |
| Subject: | note 22064 deleted from function.rmdir by spic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36828@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);
}