php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28791 The function opendir stop with error "Warning: opendir(d:/Alcatel_save): failed
Submitted: 2004-06-15 16:00 UTC Modified: 2004-07-16 01:00 UTC
Votes:29
Avg. Score:4.1 ± 1.1
Reproduced:16 of 17 (94.1%)
Same Version:8 (50.0%)
Same OS:7 (43.8%)
From: tril2632 at hotmail dot com Assigned:
Status: No Feedback Package: Directory function related
PHP Version: 4.3.7 OS: WIN 2000 PRO SERVER
Private report: No CVE-ID: None
 [2004-06-15 16:00 UTC] tril2632 at hotmail dot com
Description:
------------
Hello

The problem is that the script when he scan a sub directory in the drive cald "D", he failed with the error 
"Warning: opendir(d:/Alcatel_save): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\lister.php on line 8
".

This problem only occure when the script try to open with the "opendir" function a subdirectory in the drive "D" but with drive C: it works perfectly.

The script has no problem to open dir in the drive d: but this error only occure when he try to open a SUBDIRECTORY !!!

The permission are the same than the other directory in c: and d: driver.

Reproduce code:
---------------
<?php

$tab_deja_vu = array(); 
recurse_dir('d:', $tab_deja_vu);

function recurse_dir($rep, $tab_deja_vu)
{
$open = opendir($rep);

  while($sous_rep = readdir($open))
  {
    if(is_dir($rep . '/' . $sous_rep) && $sous_rep != '.' && $sous_rep != '..')
    {
	if(!array_key_exists($rep . '/' . $sous_rep, $tab_deja_vu))
	{
	  echo '<option value="'.$rep.'/'.$sous_rep.'">'.$rep.'/'.$sous_rep.'';
							$tab_deja_vu[] = $rep . '/' . $sous_rep;
							recurse_dir($rep . '/' . $sous_rep, $tab_deja_vu);
        }
     }
  }
 closedir($open);
}
?>

Expected result:
----------------
The script should save in the array "$tab_deja_vu" the entire directory and sub directory etc of a given directory in parameter.

Actual result:
--------------
d:/Alcatel_save
Warning: opendir(d:/Alcatel_save): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\lister.php on line 8

Warning: readdir(): supplied argument is not a valid Directory resource in C:\Inetpub\wwwroot\lister.php on line 10

Warning: closedir(): supplied argument is not a valid Directory resource in C:\Inetpub\wwwroot\lister.php on line 22
d:/Cerpass_save
Warning: opendir(d:/Cerpass_save): failed to open dir: Invalid argument in C:\Inetpub\wwwroot\lister.php on line 8

Warning: readdir(): supplied argument is not a valid Directory resource in C:\Inetpub\wwwroot\lister.php on line 10

Warning: closedir(): supplied argument is not a valid Directory resource in C:\Inetpub\wwwroot\lister.php on line 22
d:/Copilote_save


etc ... the error "supplied argument is not a valid Directory resource in C:\Inetpub\wwwroot\lister.php on " appears every time the opendir function try to open a sub directory on drive d:

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-08 13:04 UTC] sniper@php.net
Is the drive D some network share?

 [2004-07-16 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC