Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Module for file size arithmetic

by rinceWind (Monsignor)
on Mar 12, 2009 at 10:16 UTC ( #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? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2022-01-22 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?