note 102306 deleted from function.rmdir by danbrown

[email protected]
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);
   }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.