note 91038 added to function.unlink
| From: | euxneks at osu1 dot php dot net | Date: | Fri, 22 May 2009 00:06:22 +0000 |
| Subject: | note 91038 added to function.unlink | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-155860@lists.php.net to get a copy of this message | ||
Please note that unlink on an empty directory will fail with a warning - the example given above
doesn't work for the directory at least:
<?php
//testing unlink with dirs.
mkdir( 'emptydir', 0777 );
unlink( 'emptydir' );
?>
The above fails with this:
"PHP Warning: unlink(emptydir): Is a directory in /root/temp.php on line 5"
Use rmdir() on an empty directory as it works without fail or warnings.
----
Server IP: 66.207.199.35
Probable Submitter: 142.104.60.167
----
Manual Page -- http://www.php.net/manual/en/function.unlink.php
Edit -- https://master.php.net/note/edit/91038
Del: integrated -- https://master.php.net/note/delete/91038/integrated
Del: useless -- https://master.php.net/note/delete/91038/useless
Del: bad code -- https://master.php.net/note/delete/91038/bad+code
Del: spam -- https://master.php.net/note/delete/91038/spam
Del: non-english -- https://master.php.net/note/delete/91038/non-english
Del: in docs -- https://master.php.net/note/delete/91038/in+docs
Del: other reasons-- https://master.php.net/note/delete/91038
Reject -- https://master.php.net/note/reject/91038
Search -- https://master.php.net/manage/user-notes.php