Posted by Daniel Tryba on 06/08/05 17:22
RC <raymond.chui@nospam.noaa.gov> wrote:
> OK, I re-write the function, it is work, now.
So I guess you found out that you weren't setting the correct path?
Your new function might get you into trouble in case chdir() fails. You
could check if the directory you are about to readSubdir() to is
executable and readable... else there is no point to even go there.
Better yet it so fix your original code and append the found dir to the
$dirPath in the new readSubdir() call...
> while (($file = readdir($dirPointer)) != false) {
Also this will get you into trouble for files called "0". Never ever use
!= if you know that an error results in a boolean false, always use
!==/=== when types are known.
[Back to original message]
|