note 111654 added to function.is-dir
| From: | Victor | Date: | Wed, 13 Mar 2013 03:37:57 +0000 |
| Subject: | note 111654 added to function.is-dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194051@lists.php.net to get a copy of this message | ||
If you are using Mac, or others systems that store information about the directory layout and etc,
the function:
function empty_dir($dir) {
if (($files = @scandir($dir)) && count($files) <= 3)
return true;
else
return false;
}
Must have the count($files) comparing with the number of hidden files!
For example, I'm using Mac and the empty directory shows me three files: ".",
".." and ".DS_Store", so if I am planning to put the website online on my Mac,
I've to count in the ".DS_Store" file!
----
Server IP: 69.147.83.199
Probable Submitter: 189.38.130.157
----
Manual Page -- http://php.net/manual/en/function.is-dir.php
Edit -- https://master.php.net/note/edit/111654
Del: integrated -- https://master.php.net/note/delete/111654/integrated
Del: useless -- https://master.php.net/note/delete/111654/useless
Del: bad code -- https://master.php.net/note/delete/111654/bad+code
Del: spam -- https://master.php.net/note/delete/111654/spam
Del: non-english -- https://master.php.net/note/delete/111654/non-english
Del: in docs -- https://master.php.net/note/delete/111654/in+docs
Del: other reasons-- https://master.php.net/note/delete/111654
Reject -- https://master.php.net/note/reject/111654
Search -- https://master.php.net/manage/user-notes.php