On Thu, Sep 22, 2011 at 3:30 PM, Steve Simmons <[email protected]> wrote:
> I've been working on a patch to AFS so that one could add scales to numbers. 
> The primary goal is to be able to do things like
>
>   $ fs setq . 1g

commit 54c0a3f3e6575fa5af39ddd797d5381c36b48001
Author: Evan Broder <[email protected]>
Date:   Wed Mar 25 18:18:09 2009 -0500

    Allow passing in human-readable units for specifying amounts of space

    Add a util_GetHumanInt32 function for parsing numbers human-readable
    units using single-character, uppercase suffixes for indicating orders
    of magnitude (e.g. 'M', 'G').

    Use this function to parse human readable values for all arguments
    that previously accepted a value in kilobytes: fs setquota, fs
    setcachesize, vos setfields, and vos create.

    Reviewed-on: http://gerrit.openafs.org/66

?

> and get a gigabyte quota. For we who use powers of 1024, that's a helluva lot 
> easier than
>
>   $ fs setq . 1048576
>
> Especially when setting, say, 23g quotas. What, you don't have 23g == 
> 24117248 memorized? :-) While doing this I stumbled across a feature and a 
> possible bug in the fs setq command.
>
> The feature is that 'fs setq' and maybe other things accept well-formed octal 
> and hexadecimal numbers. Thus you can set a 1 gigabyte quota with any of 
> these:
>
>   $ fs setq . 0x100000
>   $ fs setq . 04000000
>   $ fs setq . 1048576
>
> And yes, negative quotas can be expressed in octal and hex.
>
> Ya learn something new every day.
>
> Steve_______________________________________________
> OpenAFS-info mailing list
> [email protected]
> https://lists.openafs.org/mailman/listinfo/openafs-info
>



-- 
Derrick
_______________________________________________
OpenAFS-info mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-info

Reply via email to