ID: 35635 User updated by: plesek at nln dot cz Reported By: plesek at nln dot cz Status: Bogus Bug Type: Directory function related Operating System: Windows XP Professional SP2 PHP Version: 4.4.1 New Comment:
You're right of course, my apologies, I won't try to report bugs after 9 hours of work. Iteresting notice: Got my code working on linux box, rather confusing,but never mind. Thanks anyway Previous Comments: ------------------------------------------------------------------------ [2005-12-11 21:59:27] [EMAIL PROTECTED] Did you try to see what's in the $element? Of course it doesn't work, you need to do it this way: is_dir("./whatever/".$element); No bug here. ------------------------------------------------------------------------ [2005-12-11 21:54:18] plesek at nln dot cz Description: ------------ The behavior of following code is rather unpredictable. In the case of opendir("."), all works perfecty, but if you add something like /anotherdir, then you run into problems. In this example, let's assume we have dir structure ./whatever/ with another 2 folders and files. The result CAN be, as following, but it happened to me, that all dirs were recognized correctly or for example only one was. Only special dirs, . and .. are recognized. I tried several tips, that were on the internet, like ending slash, or backslashes instead of normal ones (windows), with no result. And on different folders, again the same, with minor fluctuations, as mentioned above. And as for is_file, te result will be all false in any case, tried several times.Again, it applies only for other directories, than "." All extensions disabled,of course. Reproduce code: --------------- $handler=opendir("./whatever"); while($element=readdir($handler)) { $tmp=is_dir($element); var_dump($tmp); echo " $element<br/>"; } Expected result: ---------------- bool(true) dir1 bool(true) dir2 bool(false) file1.txt bool(false) file2.txt Actual result: -------------- bool(false) dir1 bool(false) dir2 bool(false) file1.txt bool(false) file2.txt ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35635&edit=1