Hi!
I have a problem with scanning a directory for files.
If there are less than 3 files in the directory, the
script quits executing. Any thoughts?
This is how I am scanning my directory; note that I have a check to exclude filenames less than 3 characters to get rid of the . and .. entries. It echoes <option> brackets because I display the results in a list box.
cout << "If you don't know where you want to go, we'll make sure you get taken";
I have a problem with scanning a directory for files.
If there are less than 3 files in the directory, the
script quits executing. Any thoughts?
This is how I am scanning my directory; note that I have a check to exclude filenames less than 3 characters to get rid of the . and .. entries. It echoes <option> brackets because I display the results in a list box.
Code:
[blue]
$myDir = opendir('/BlahDir');
while (false !== ($file = readdir($myDir)))
{
if (strlen($file)>3) echo "<option value =\"$file\">$file</option>";
} [green]//END WHILE[/green]
closedir($myDir);
[/blue]
cout << "If you don't know where you want to go, we'll make sure you get taken";