php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49928 basicly, im used php 5.2.9
Submitted: 2009-10-19 20:55 UTC Modified: 2009-10-20 08:32 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: jmyeom at hotmail dot com Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.3.0 OS: txt file is a directory
Private report: No CVE-ID: None
 [2009-10-19 20:55 UTC] jmyeom at hotmail dot com
Description:
------------
im used php 5.2.9

after running some tests, it keeps telling me a txt file IS A DIRECTORy.. then fails to open it


if this is human error, im sorry and could you point me in the right direction?




Reproduce code:
---------------
function a($hutpear) {
	$abc = $hutpear;
	if ($handle = opendir($abc)) {
		while (false !== ($file = readdir($handle))) {
			if ($file != "." && $file != "..") {
				if  (!is_file($file)) {
					a($abc . "/" . $file);
				} else {
					echo "$file\n";
				}
			}
		}
		closedir($handle);
	}
}

a("photos");

Expected result:
----------------
thisisafile.txt

Actual result:
--------------
br />
<b>Warning</b>:  opendir(photos/1/thisisatextdocument.txt) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: Not a directory in <b>/home/y02wals/public_html/test.php</b> on line <b>6</b><br />

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-19 20:58 UTC] jmyeom at hotmail dot com
sorry, forgot this, a more detailed report is here:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/Q_24824474.html#a25608711
 [2009-10-20 08:32 UTC] jani@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC