Source-Changes archive

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

Re: CVS commit: src/usr.bin/split




To: Jan Schaumann <jschauma%NetBSD.org@localhost>

Subject: Re: CVS commit: src/usr.bin/split

From: Alan Barrett <apb%cequrux.com@localhost>

Date: Thu, 31 May 2007 08:09:01 +0200


On Thu, 31 May 2007, Jan Schaumann wrote:
> Modified Files:
>       src/usr.bin/split: split.1 split.c
> 
> Log Message:
> Add a new command-line option "-n chunk_count", that splits the input
> file into chunk_count smaller files.  Each file will be size/chunk_count
> bytes large, with whatever spillover there is ending up in the chunk_counth
> file.

If you change this line in split3() from

        split1(sb.st_size/chunks, chunks);

to

        split1((sb.st_size + chunks - 1)/chunks, chunks);

then the last file will never be larger than the others, there won't
be any "spillover", and you can remove all the new special cases in
split1().

--apb (Alan Barrett)



Follow-Ups:

Re: CVS commit: src/usr.bin/split
From: John Darrow

Re: CVS commit: src/usr.bin/split
From: Jan Schaumann


References:

CVS commit: src/usr.bin/split
From: Jan Schaumann




Prev by Date: CVS commit: src/sys

Next by Date: Re: CVS commit: src/sys/sys

Previous by Thread: CVS commit: src/usr.bin/split

Next by Thread: Re: CVS commit: src/usr.bin/split

Indexes:

reverse Date

reverse Thread

Old Index



Home | Main Index | Thread Index | Old Index