Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Module for file size arithmetic

by rinceWind (Monsignor)
on Mar 12, 2009 at 10:16 UTC ( [id://750115]=note: print w/replies, xml ) Need Help??


in reply to Module for file size arithmetic

It's probably a sledge hammer to crack a nut, but take a look at Data::Dimensions, which could probably also handle sizes in sectors, tracks and the like, given the parameters for the disk geometry.

Replies are listed 'Best First'.
Re^2: Module for file size arithmetic
by mirod (Canon) on Mar 12, 2009 at 10:42 UTC

    My first test gets me a segmentation fault, so I'm not sure...

    perl -M'Data::Dimensions qw(:extended &units)' -E'say add( "1.2G", "50 +0M"); \ sub add \ { my $sum= units( { byte => 0 }); \ foreach (@_) { $sum += $_ } \ return $sum; \ }\ '

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://750115]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-24 04:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found