note 36378 added to function.is-dir
| From: | info at rn2 dot php dot net | Date: | Wed, 08 Oct 2003 08:03:41 +0000 |
| Subject: | note 36378 added to function.is-dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58024@lists.php.net to get a copy of this message | ||
If given string is not any filesystem entry, I had problems in some PHP versions (not: 4.06 and
4.1.2).
Command
if (is_dir($string)) { }
results in error
stat failed (errno=2 - No such file or directory)
To resolve simply change command to
if (file_exists($string) && is_dir($string)) { }
----
Manual Page -- http://www.php.net/manual/en/function.is-dir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36378
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36378&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36378&report=yes
Search -- http://master.php.net/manage/user-notes.php