note 102306 deleted from function.rmdir by danbrown
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
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);
}
}