From: tril2632 at hotmail dot com
Operating system: WIN 2000 PRO SERVER
PHP version: 4.3.7
PHP Bug Type: Directory function related
Bug description: The function opendir stop with error "Warning:
opendir(d:/Alcatel_save): failed
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 bug report at http://bugs.php.net/?id=28791&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28791&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28791&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28791&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28791&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28791&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28791&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28791&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28791&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28791&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28791&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28791&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28791&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28791&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28791&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28791&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28791&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28791&r=float