note 108396 modified in splfileobject.construct by salathe

From: 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 &#34;permission denied&#34; in the error log. &#13;&#10;&#13;&#10;In my oppinion this is not a php error but a difference between directory handling on windows and unix systems.&#13;&#10;&#13;&#10;&#60;?php&#13;&#10;$file = new SplFileObject($filename);&#13;&#10;&#13;&#10;if($file-&#62;isDir() {&#13;&#10; echo &#34;foo&#34;;&#13;&#10;}&#13;&#10;?&#62;&#13;&#10;&#13;&#10;will not work, but&#13;&#10;&#13;&#10;&#60;?php&#13;&#10;if(is_dir($filename)) {&#13;&#10; $file = new SplFileObject($filename);&#13;&#10;}&#13;&#10;?&#62;&#13;&#10;&#13;&#10;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

« previous php.notes (#187300) next »