note 108396 modified in splfileobject.construct by salathe
| From: | salathe@php.net | Date: | Mon, 23 Apr 2012 13:15:08 +0000 |
| Subject: | note 108396 modified in splfileobject.construct by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187300@lists.php.net to get a copy of this message | ||
I had a problem using SplFileObject on a windows system running win2k8r2 server and iis. Creating an
SplFileObject from a directory results in a 500 internal server error and a "permission
denied" in the error log. In my oppinion this is not a
php error but a difference between directory handling on windows and unix
systems. <?php $file = new
SplFileObject($filename); if($file->isDir()
{ echo
"foo"; } ?> will
not work,
but <?php if(is_dir($filename))
{ $file = new
SplFileObject($filename); } ?> will.
--was--
I had a problem using SplFileObject on a windows system running win2k8r2 server and iis. Creating an
SplFileObject from a directory results in a 500 internal server error and a "permission
denied" in the error log.
In my oppinion this is not a php error but a difference between directory handling on windows and
unix systems.
<pre>$file = new SplFileObject($filename);
if($file->isDir() {
echo "foo";
}</pre>
will not work, but
<pre>if(is_dir($filename)) {
$file = new SplFileObject($filename);
}</pre>
will.
http://php.net/manual/en/splfileobject.construct.php