Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 08/11/18 09:02, Wolaver, David wrote:
> Hi all,
>
> I have developed a command line program that I would like to have considered
> for inclusion in a future revision of coreutils. The name of the program is
> "curtail". It reads stdin and appends to an output file while ensuring that
> the file will never exceed a specified maximum size. The main intent is to
> place a bound on the output of a program such that it cannot create a runaway
> log file. The output file is truncated (in multiple of block size) at the
> beginning such that the output file always contains the latest output of the
> program.
>
> user_program | curtail -s 4M output.txt
It's a perfect name for such a command anyway :)
Does this depend on FALLOC_FL_COLLAPSE_RANGE support.
Would this command fail on file systems not supporting this?
Being block based seems a little problematic,
especially considering multi-byte characters,
but maybe that's OK.
cheers,
Pádraig