Converting bytes to mb currently using stat [7] function
$30-5000 USD
Cerrado
Publicado hace casi 22 años
$30-5000 USD
Pagado a la entrega
Greetings, I simply need some help to find out how to convert the current filesize using stat [7] function from bytes to megabytes? "I have it pretty close but no cigar" I can't find any examples anywhere and would be greatful for your assistance in this matter. Below is my current code: *The array symbol has been removed for the posting ==================================================== opendir(IMD, $dir) || die("Cannot open directory"); thefiles= readdir(IMD); closedir(IMD); foreach $f ( sort thefiles ) { $full = "$dir/$f"; next unless ( -f "$full" ); $size = ( stat $full )[7]; $size = $size /1000000; print( " [$f][1] - size: $size
\n" ); }
## Deliverables
Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.
## Platform
Unix Perl 5.04