note 32534 added to function.rmdir

From: Date: Fri, 30 May 2003 12:41:52 +0000
Subject: note 32534 added to function.rmdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-49422@lists.php.net to get a copy of this message
I have had trouble with rmdir, and I didn't understant why. I wrote : ___$d = dir ($path); ___for (;($file = $d->read());) ___{ ______if (($file == ".") || ($file == "..")) continue; ______unlink ("$path/$file"); ___} ___$d->close(); ___rmdir ("$path"); but the rmdir() didn't work... In fact, you have to first destroy de directory pseudo-object with : ___unset ($d); ... just before the rmdir ("$path"); command. Hope this helps... ---- Manual Page -- http://www.php.net/manual/en/function.rmdir.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32534 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32534&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32534&report=yes

« previous php.notes (#49422) next »