|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-08 13:04 UTC] sniper@php.net
[2004-07-16 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
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: