note 102306 deleted from function.rmdir by danbrown
| From: | danbrown@php.net | Date: | Tue, 08 Feb 2011 12:28:07 +0000 |
| Subject: | note 102306 deleted from function.rmdir by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176765@lists.php.net to get a copy of this message | ||
Note Submitter: dev at hyperoptix dot com
----
Linux - If I delete the only file in a directory, then attempt to delete the directory in the
following statement, I get a "Directory not empty" warning. To prevent the warning:
if(is_file(adirectory/afile)) {
if (unlink(adirectory/afile)) {
if (is_dir(adirectory)) rmdir(adirectory);
}
}