I'm not quite sure why that doesn't work, but here's another way to get a count:
<?
if ($handle = opendir('coins/')) {
$count = "0";
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$count++;
}
}
}
closedir($handle);
echo $count . " files in directory";
?>
Cgraz