|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-16 05:44 UTC] yves at monet dot be
Hello, I'm running php 4.0.5 on my win ME & Win NT 4.0 and I have experienced 2 functions returning the wrong values. I don't know if this bug is allready reported. the is_dir() allways returns false except for "." && ".." the filetype() allways returns dir PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
A little script that should echo alle filetypes of all files in any subdir of the parent provided. Now I use opendir to test wether the file is a dir, but this isn't a good solution, is it? The is_dir() allways returns false the filetype() allwyas returns dir <?php function getFileInfo($parent) { $handle = opendir($parent); while ($file = readdir($handle)) { $filelist[]=$file ; } reset($filelist); while(list(,$f)=each ($filelist)) { if ($f!="." && $f!="..") { if(is_dir($f)) { getFileInfo($f); } else { echo filetype($f); } } } } getFileInfo("c:\data\pdf"); ?>