#30296 [Opn->Bgs]: opendir does not like have a number as the first char
ID: 30296
Updated by: aidan@php.net
Reported By: dravet at calumet dot purdue dot edu
-Status: Open
+Status: Bogus
Bug Type: Directory function related
Operating System: Windows 2003 Enterprise
PHP Version: 4.3.9
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
It has nothing to do with opendir.
By using double quotes you instruct PHP to parse the string. \100
parses to @.
Use single quotes for strings.
Previous Comments:
------------------------------------------------------------------------
[2004-10-01 01:08:28] dravet at calumet dot purdue dot edu
Description:
------------
Opendir does not appear to like having a number as the first char of a
directory name. If I rename 100LEVEL to LEVEL100 then the code works.
Reproduce code:
---------------
$current_dir "D:\htdocs\assessment\form40s\approved\100LEVEL";
$dir = opendir($current_dir);
while (false !== ($file=readdir($dir)))
{
print $file;
}
closedir($dir);
Expected result:
----------------
CIS100.pdfCIS103 (TECH 03-26) pdf.pdfCIS103.pdfCIS111(TECH 03-33)
.pdfCIS111.pdfCIS140.pdfCIS166 FALL-2004.pdfCIS166(TECH
04-04).pdfCIS166- 2000.pdfCIS180(TECH
03-34).pdfCIS180.pdfCIS187.pdfFall 2003 Tech School Network.mdbFall
2003 Tech School.lnk
This is the results when the directory is named LEVEL100. I will
format the text later.
Actual result:
--------------
PHP Warning: opendir(D:\htdocs\assessment\form40s\approved@LEVEL):
failed to open dir: Invalid argument in
D:\htdocs\assessment\form40s\approved\index.php on line 14 PHP Warning:
readdir(): supplied argument is not a valid Directory resource in
D:\htdocs\assessment\form40s\approved\index.php on line 15 PHP Warning:
closedir(): supplied argument is not a valid Directory resource in
D:\htdocs\assessment\form40s\approved\index.php on line 20
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30296&edit=1
Thread (2 messages)