note 65917 added to function.rmdir
| From: | nick at customdesigns dot ca | Date: | Wed, 10 May 2006 07:06:58 +0000 |
| Subject: | note 65917 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111018@lists.php.net to get a copy of this message | ||
I don't understand what the fuss below is about with creating a recursive rmdir function. Mine
is simple:
public static function RecursiveRMDir($path)
{
if(!is_dir($path))
{
trigger_error("<p>{$path} is not a directory!</p>", E_USER_ERROR);
}
$dir = dir($path);
while (false !== ($dir_entry = $dir->read()))
{
if(($dir_entry != ".") && ($dir_entry != ".."))
{
if(!is_dir("{$path}/{$dir_entry}"))
{
unlink("{$path}/{$dir_entry}");
}
else
{
Utilities::RecursiveRMDir("{$path}/{$dir_entry}");
}
}
}
rmdir($path);
}
----
Server IP: 66.207.199.35
Probable Submitter: 68.147.32.226
----
X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.rmdir.php
Edit -- http://master.php.net/note/edit/65917
Del: integrated -- http://master.php.net/note/delete/65917/integrated
Del: useless -- http://master.php.net/note/delete/65917/useless
Del: bad code -- http://master.php.net/note/delete/65917/bad+code
Del: spam -- http://master.php.net/note/delete/65917/spam
Del: non-english -- http://master.php.net/note/delete/65917/non-english
Del: in docs -- http://master.php.net/note/delete/65917/in+docs
Del: other reasons-- http://master.php.net/note/delete/65917
Reject -- http://master.php.net/note/reject/65917
Search -- http://master.php.net/manage/user-notes.php