Imagine the following:

362>class someClass {
363>  function someFunction() {
364>    if($rDirectory = opendir("/templates")) {
365>      while(false != ($strFile = readdir($srDirectory))) {
366>        print $strFile."<br />";
367>     }
368>   }     
369>  }
370>}

The class is constructed successfully, the function is called successfuly, the if($rDirectory = opendir("/templates")) statement returns true, and the directory most certainly exists, but as soon as an attempt to read the contents of the directory occurs, the once valid resource ($rDirectory) becomes invalid:

Warning: readdir(): 36 is not a valid Directory resource in D:\inetpub\wwwroot\phpSLearningDev\root\components\installer\inc\installer.php on line 365

if the code is removed from both the class and function, it executes fine.

I am currently working on a Windows 2003 server (not my choice) and an internal (non network (SMB)) HDD.

I can't imagine that simply being inside a class could cause this.

Am I missing something!?!?!? I regard myself as a fairly proficient PHP developer, but this one has got a whole dev team stumped.

Any thoughts appreciated.

Matt Richards

matt_DOT_richards_AT_NOSPAM_safetymedia_DOT_co_DOT_uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to