brothercake
01-24-2003, 11:46 AM
My apologies if this has been asked before - I couldn't find it in search ..
I have a listing script like this:
<?
//define the path as relative to here
$path = ".";
//open directory for list
$dir_handle = opendir($path) or die("Unable to open $path");
//print filenames function
function printFileNames($ext) {
global $docList,$dir_handle;
while ($file = readdir($dir_handle)) {
if(ereg("\.".$ext,$file)) {
$docList .= "\t<li><a href=\"$file\" target=\"_blank\">$file</a></li>\n";
}
}
}
//list of word documents
$docList = "<p>The following documents are available in MS Word format:";
$docList .= "<ul>\n";
printFileNames("doc");
$docList .= "</ul>\n";
//echo list
echo ($docList);
//close directory
closedir($dir_handle);
?>
Is there a way I can include in the output the size of each file, without opening them all
I have a listing script like this:
<?
//define the path as relative to here
$path = ".";
//open directory for list
$dir_handle = opendir($path) or die("Unable to open $path");
//print filenames function
function printFileNames($ext) {
global $docList,$dir_handle;
while ($file = readdir($dir_handle)) {
if(ereg("\.".$ext,$file)) {
$docList .= "\t<li><a href=\"$file\" target=\"_blank\">$file</a></li>\n";
}
}
}
//list of word documents
$docList = "<p>The following documents are available in MS Word format:";
$docList .= "<ul>\n";
printFileNames("doc");
$docList .= "</ul>\n";
//echo list
echo ($docList);
//close directory
closedir($dir_handle);
?>
Is there a way I can include in the output the size of each file, without opening them all