This script

    <?php
    $test = scan_directory('g:/', $files);
    
    function scan_directory($directory, &$files) {
      $handle = opendir($directory);
    
      while (false !== ($file = readdir($handle))) { 
        if ($file != '.' && $file != '..') { 
          if (!@is_dir($directory . $file)) {
            if (substr($file, -3) == 'mp3') {
              $files[] = $directory . '//' . $file;
            }
          } else {
            scan_directory($directory . $file, $files);
          }
        } 
      }
    
      closedir($handle); 
    }
    ?>

  gives error messages like

    Warning: OpenDir: Invalid argument (errno 22) in 
    e:\server\htdocs\test.php on line 5

    Warning: Supplied argument is not a valid Directory 
    resource in e:\server\htdocs\test.php on line 7

  and then crashes with an 'unknown software exception'.

  Configuration: PHP 4 built from latest CVS as CGI on Win32.

  The scan_directory() function worked fine, back when I wrote it -
which was some weeks ago.

-- 
  Sebastian Bergmann                     Measure Traffic & Usability
  http://sebastian-bergmann.de/            http://phpOpenTracker.de/

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to