Pat Richard wrote:
Without actually trying it, the first thing that comes to mind is to
insert a counter in your while loop. If, at the conclusion of the loop,
it only == 2, then you're likely in an empty directory (you'd have the .
And .. To give you the two).
Make sense?
Something I nabbed off Google and modified a bit:
function isEmptyDir($dirName)
{
$result = true;
if(! is_dir($dirName))
{
trigger_error('Not a directory', E_USER_ERROR);
}
$handle = opendir($dirName);
while(($file = readdir($handle)) !== false)
{
if($file != '.' && $file != '..')
{
$result = false;
break;
}
}
closedir($handle);
return $result;
}
hth,
Stephen
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.