bug-coreutils
[Top][All Lists]
Advanced

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

Re: mkfile -- create large files efficiently


From: Jim Meyering
Subject: Re: mkfile -- create large files efficiently
Date: Mon, 09 Feb 2009 09:17:01 +0100

Pádraig Brady <address@hidden> wrote:
> Matej Cepl wrote:
>> On 2009-02-08, 00:01 GMT, Pádraig Brady wrote:
>>> It wasn't called after the system call. It was called after the
>>> function it was providing. mkfile isn't the best name either BTW.
>>> Also the existing `truncate` command in freebsd which
>>> swayed the choice of name.
>>
>> OK, so what do you suggest to do? Should I patch truncate with
>> posix_fallocate, or there is at least some hope for mkfile (I
>> still like the name)?
>
> I would suggest patching a --allocate option into truncate.
> Then mkfile can be implemented as a script something like:
>
> (truncate --allocate || dd if=/dev/zero ) && chmod u+t
>
> This is just one opinion though.
> I'd get other opinions before doing anything.

I have to agree.
The hook to call fallocate seems like it belongs with
the functionality already provided by truncate.

BTW, before the truncate program was written for coreutils, I'd been
using a perl script with the same name and similar functionality,
for about 8 years.  That (its utility) plus the fact that it performs
a task not easy to do without a scripting language like Perl, were
deciding factors in adding the program.

mkfile seems less useful, but does have the redeeming quality
that it's already provided by a few Unix vendors, so let's put
it in contrib and make it optionally-installable.
The plan being: if there is sufficient demand, eventually it would
graduate to being installed by default.




reply via email to

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