#49928 [Opn]: basicly, im used php 5.2.9
ID: 49928
User updated by: jmyeom at hotmail dot com
Reported By: jmyeom at hotmail dot com
Status: Open
Bug Type: Directory function related
Operating System: txt file is a directory
PHP Version: 5.3.0
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2009-10-19 20:55:38] 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 />
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49928&edit=1
Thread (3 messages)