1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 03:12:48 +02:00

split: support split -n on larger pipe input

* bootstrap.conf (gnulib_modules): Add free-posix, tmpfile.
* src/split.c (copy_to_tmpfile): New function.
(input_file_size): Use it to split larger files when sizes cannot
easily be determined via fstat or lseek.  See Bug#61386#235.
* tests/split/l-chunk.sh: Mark tests of /dev/zero as
very expensive since they exhaust /tmp.
This commit is contained in:
Paul Eggert
2023-03-07 12:58:12 -08:00
parent 35ac97e0d6
commit bb9dbcbbfd
5 changed files with 71 additions and 42 deletions

View File

@@ -37,12 +37,15 @@ rm x??
# 'split' should reject any attempt to create an infinitely
# long output file.
returns_ 1 split -n l/2 /dev/zero || fail=1
rm x??
# This test is very expensive as it runs out of /tmp space.
if test "${RUN_VERY_EXPENSIVE_TESTS+set}" = set; then
returns_ 1 split -n l/2 /dev/zero || fail=1
rm x??
# Repeat the above, but with 1/2, not l/2:
returns_ 1 split -n 1/2 /dev/zero || fail=1
rm x??
# Repeat the above, but with 1/2, not l/2:
returns_ 1 split -n 1/2 /dev/zero || fail=1
rm x??
fi
# Ensure --elide-empty-files is honored
split -e -n l/10 /dev/null || fail=1