php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42784 readdir() does not show single integer filenames
Submitted: 2007-09-27 22:23 UTC Modified: 2007-09-27 22:32 UTC
From: php at mike2k dot com Assigned:
Status: Closed Package: Directory function related
PHP Version: 5.2.4 OS: Debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at mike2k dot com
New email:
PHP Version: OS:

 

 [2007-09-27 22:23 UTC] php at mike2k dot com
Description:
------------
readdir() is working properly on other dirs, but on the dir with files "0" "1" "2" etc, it doesn't seem to find the files.

the files have read permissions, as does the directory, there's no issues there.


Reproduce code:
---------------
$dir = "somedirectory/foo/bar";
if(is_dir($dir)) {
	$objdir = opendir($dir);
	while($file = readdir($objdir)) {
		var_dump($file);
...


Expected result:
----------------
produces this:

string(1) "."
string(2) ".."


Actual result:
--------------
however there are 6 files in the directory with single integer values:

linux01:~/data$ ls somedirectory/foo/bar
0  1  2  3  4  5

those are completely ignored it appears.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-27 22:32 UTC] php at mike2k dot com
it appears to be localized to my setup, but still can't figure out why this is happening. it won't list any files in any of the subdirs, but is_dir() passes and the directory is legit. weird.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 17:01:30 2024 UTC