bug#46048: split -n K/N loses data, sum of output files is smaller than input file.

2021-02-08 Thread Pádraig Brady
On 25/01/2021 14:21, Pádraig Brady wrote: On 24/01/2021 19:55, Paul Eggert wrote: On 1/24/21 8:52 AM, Pádraig Brady wrote: -  if (lseek (STDIN_FILENO, start, SEEK_CUR) < 0) +  if (lseek (STDIN_FILENO, start, SEEK_SET) < 0) Dumb question: will this handle the case where you're

bug#46048: split -n K/N loses data, sum of output files is smaller than input file.

2021-01-25 Thread Pádraig Brady
On 24/01/2021 19:55, Paul Eggert wrote: On 1/24/21 8:52 AM, Pádraig Brady wrote: -  if (lseek (STDIN_FILENO, start, SEEK_CUR) < 0) +  if (lseek (STDIN_FILENO, start, SEEK_SET) < 0) Dumb question: will this handle the case where you're splitting from stdin and stdin is a seekable file

bug#46048: split -n K/N loses data, sum of output files is smaller than input file.

2021-01-24 Thread Paul Eggert
On 1/24/21 8:52 AM, Pádraig Brady wrote: -  if (lseek (STDIN_FILENO, start, SEEK_CUR) < 0) +  if (lseek (STDIN_FILENO, start, SEEK_SET) < 0) Dumb question: will this handle the case where you're splitting from stdin and stdin is a seekable file and its initial file offset is nonzero?

bug#46048: split -n K/N loses data, sum of output files is smaller than input file.

2021-01-24 Thread Pádraig Brady
On 24/01/2021 16:52, Pádraig Brady wrote: diff --git a/src/split.c b/src/split.c index 0660da13f..6aa8d50e9 100644 --- a/src/split.c +++ b/src/split.c @@ -1001,7 +1001,7 @@ bytes_chunk_extract (uintmax_t k, uintmax_t n, char *buf, size_t bufsize, } else { - if (lseek

bug#46048: split -n K/N loses data, sum of output files is smaller than input file.

2021-01-24 Thread Pádraig Brady
On 23/01/2021 04:58, Paul Hirst wrote: split --number K/N appears to lose data in, with the sum of the sizes of the output files being smaller than the original input file by 131072 bytes. $ split --version split (GNU coreutils) 8.30 ... $ head -c 100 < /dev/urandom > test.dat $ split

bug#46048: split -n K/N loses data, sum of output files is smaller than input file.

2021-01-23 Thread Paul Hirst
split --number K/N appears to lose data in, with the sum of the sizes of the output files being smaller than the original input file by 131072 bytes. $ split --version split (GNU coreutils) 8.30 ... $ head -c 100 < /dev/urandom > test.dat $ split --number=1/4 test.dat > t1 $ split