#28791 [Opn->Fbk]: The function opendir stop with error "Warning: opendir(d:/Alcatel_save): failed

From: Date: Thu, 08 Jul 2004 11:04:37 +0000
Subject: #28791 [Opn->Fbk]: The function opendir stop with error "Warning: opendir(d:/Alcatel_save): failed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61909@lists.php.net to get a copy of this message
ID: 28791 Updated by: sniper@php.net Reported By: tril2632 at hotmail dot com -Status: Open +Status: Feedback Bug Type: Directory function related Operating System: WIN 2000 PRO SERVER PHP Version: 4.3.7 New Comment: Is the drive D some network share? Previous Comments: ------------------------------------------------------------------------ [2004-06-15 16:00:48] 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: ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28791&edit=1

« previous php.bugs (#61909) next »