[Top][All Lists]

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

Re: split behavior

From: Pádraig Brady
Subject: Re: split behavior
Date: Sat, 12 Sep 2009 05:12:56 +0100
User-agent: Thunderbird (X11/20071008)

Eric Blake wrote:
> According to Roger McNichols on 9/11/2009 6:51 PM:
>> Currently using version 5.2.1 of coreutils 'split' command produces files 
>> with 'intelligent' suffixes.  That is, the number of letters (or digits) 
>> required
>> is based on the known number of output files that will be required.
> coreutils 5.2.1 is quite old; the latest stable version is 7.6.
> Thanks for the report.  That said, POSIX requires that split stop
> processing input and give an error after suffixes have been exhausted,
> rather than using longer suffixes:
> http://www.opengroup.org/onlinepubs/9699919799/utilities/split.html

That goes against the GNU "no limits" policy though.
How about we fail only if POSIXLY_CORRECT is set or
if the suffix len is specified and is too small.
Otherwise we use the zzaa, zzab method as described before.

> But at least there is the -n option to specify a larger suffix.

right, -a.
As an aside, I just noticed FreeBSD has -n to specify the number of
chunks rather than the size. That's a very useful feature
that was already on my TODO list.

> If you are still worried about running out of suffixes, then it would
> probably be worth implementing a command line option that allows split to
> use intelligent suffixes; we can't make it the default because of POSIX,
> but we can at least provide it via a new option.  Would you like to submit
> the patch?

Do you mean select the appropriate suffix length based on size,
or do you mean the zzaa, zzab scheme? The former wouldn't
help when processing a pipe for example so I'd probably
stick with the latter method for consistency.


reply via email to

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