I am having some trouble getting the file size operator to work right. I have something like:
--------------------------------------
$myfolder = "c:/test";
opendir(DIR, $myfolder) or die "cant open $myfolder $!";
while (defined ($filename = readdir(DIR)))
{
$sum = -s $filename;
print "sum: $sum file: $filename\n";
}
---------------------------------------
It gets the file names correctly, however, it seems that
it cannot return the size of the file. I was pretty sure that "-s $filename" would work, but it returns nothing.
If any1 have an idea whats going on here please help. Thanks.
--------------------------------------
$myfolder = "c:/test";
opendir(DIR, $myfolder) or die "cant open $myfolder $!";
while (defined ($filename = readdir(DIR)))
{
$sum = -s $filename;
print "sum: $sum file: $filename\n";
}
---------------------------------------
It gets the file names correctly, however, it seems that
it cannot return the size of the file. I was pretty sure that "-s $filename" would work, but it returns nothing.
If any1 have an idea whats going on here please help. Thanks.