bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] fallocate utility


From: Pádraig Brady
Subject: Re: [RFC] fallocate utility
Date: Fri, 31 Jul 2009 21:27:57 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Eric Sandeen wrote:
> Giuseppe Scrivano wrote:
>> Hello,
>>
>> Pádraig Brady <address@hidden> writes:
>>
>>> Tilman Schmidt wrote:
> 
> ...
> 
>>>> Why not make it, in the best Unix tradition, a single
>>>> executable whose action depends on the name it is run as?
>>> Hmm. Good idea.
>>> There is precedent for that already in coreutils.
>> What do you think about having two separate executables?  Considering
>> fallocate and truncate will share almost all code, these differences can
>> be separed at compilation-time.  It seems that the same approach is
>> already used by md5sum and shaXXXsum.
> 
> I'm curious - how much code will be shared, really?
> 
> in terms of functionality, truncate currently has:
> 
>        -c, --no-create
>               do not create any files
>        -o, --io-blocks
>               Treat SIZE as number of IO blocks instead of bytes
>        -r, --reference=FILE
>               use this FILE’s size
>        -s, --size=SIZE
>               use this SIZE
>        --help display this help and exit
>        --version
>               output version information and exit
> 
> the_util_previously_known_as_fallocate would have something like:
> 
>        -c, --no-create
>               do not create any files
>        -o, --offset=OFFSET
>               start allocation at this OFFSET (0 default)
>        -l, --length=LENGTH
>               allocate this LENGTH starting at OFFSET (or 0)
>        -n, --no-size-update
>               do not change i_size (allow blocks past EOF)
>        --help display this help and exit
>        --version
>               output version information and exit

I was thinking the new fallocate util would have the
same options as the existing truncate util.
I.E. -n or -o would not be needed or supportable in all situations.
If you think that users would need those, then I suggest
adding the linux specific fallocate util to util-linux-ng,
and we'll add the more generic `truncate --allocate`
(or separate command) to coreutils.

cheers,
Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]