From owner-freebsd-arch@FreeBSD.ORG Fri Sep 17 08:39:05 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B50D16A4D0; Fri, 17 Sep 2004 08:39:05 +0000 (GMT) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98C2F43D45; Fri, 17 Sep 2004 08:39:04 +0000 (GMT) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.34) id 1C8EY2-0007OF-FQ; Fri, 17 Sep 2004 15:56:54 +0700 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i8H8fl0m047945; Fri, 17 Sep 2004 15:41:47 +0700 (NOVST) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i8H8flQp047886; Fri, 17 Sep 2004 15:41:47 +0700 (NOVST) (envelope-from danfe) Date: Fri, 17 Sep 2004 15:41:46 +0700 From: Alexey Dokuchaev To: Pawel Jakub Dawidek Message-ID: <20040917084146.GA45371@regency.nsu.ru> References: <20040916184201.GD30151@darkness.comp.waw.pl> <20040917040445.GA52078@regency.nsu.ru> <20040917081416.GL30151@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040917081416.GL30151@darkness.comp.waw.pl> User-Agent: Mutt/1.4.2.1i cc: freebsd-arch@freebsd.org Subject: Re: New libutil function: parse_capacity(3). X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2004 08:39:05 -0000 On Fri, Sep 17, 2004 at 10:14:16AM +0200, Pawel Jakub Dawidek wrote: > On Fri, Sep 17, 2004 at 11:04:45AM +0700, Alexey Dokuchaev wrote: > +> > I implemented parse_capacity() function which can be use to convert a > +> > string with a human-readable capacity value to a off_t value. > +> > > +> > It can be used by utilities like: > +> > > +> > % truncate -s 8g test > +> > # mdconfig -a -t malloc -s 16M > +> > > +> > Patch can be found here: > +> > > +> > http://people.freebsd.org/~pjd/patches/parse_capacity.patch > +> > > +> > Any comments before committing? > +> > +> Methinks you could probably come up with a better name, since > +> "engeneering number mode" (using K, M, T, etc) is used for bandwidth, > +> for instance, not just for `capacity'. IMHO. Making it that user can > +> easily guess its name from already-there humanize_number(3). > > Fell free to suggest a better one:) > I talked about this name with few people before name was choosen and > this is the list of proposals: > > - dehumanize_number(), This one is good. > - parse_humanized_humber(), And this one. > > :) > I really don't want to start bikeshed about function name here. Neither do I. I just wanted to point out that `capacity' probably isn't the best choice. ./danfe