Skip to content

split: print "creating file" with --verbose in the -n modes - #15600

Open
fixfon wants to merge 1 commit into
uutils:mainfrom
fixfon:fix/15583-split-verbose-n
Open

fixfon wants to merge 1 commit into
uutils:mainfrom
fixfon:fix/15583-split-verbose-n

Conversation

@fixfon

@fixfon fixfon commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

In the -n modes, split --verbose never printed "creating file". Those modes open their output files through OutFiles (init, and instantiate_writer for the lazy -e path), and neither of them called print_creating_file, which is what -b, -l and -C already use.

Both paths now call it right before the file is opened. I also added an announced flag on OutFile, so a file that gets reopened because of the fd limit isn't announced a second time. The K/N forms write to stdout and create no file, so they still print nothing.

Added test_verbose_number_of_chunks, which covers 14 combinations and fails on main, plus a small test checking that -n K/N stays quiet. I also compared the output against GNU 9.12 split on macOS for -n N, l/N, r/N, with and without -e, and for empty input. Output and order match in all of them.

Not touched, since main already behaves this way: with --filter, GNU prints "executing with FILE=..." while we print "creating file". When it runs into a low ulimit -n, GNU also announces a file again each time it reopens it.

Fixes #15583

@xtqqczze

This comment was marked as outdated.

@xtqqczze

This comment was marked as resolved.

@fixfon
fixfon force-pushed the fix/15583-split-verbose-n branch from bb20494 to 8b7cc48 Compare October 26, 2026 18:24
@fixfon

fixfon commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Squashed into a single commit as requested. Happy to adjust anything else, thanks for taking a look.

xtqqczze

This comment was marked as resolved.

@fixfon
fixfon force-pushed the fix/15583-split-verbose-n branch from 8b7cc48 to eec73fc Compare October 29, 2026 18:32
@fixfon

fixfon commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Switched the new tests to #[rstest] cases.

@xtqqczze

This comment was marked as outdated.

@xtqqczze

This comment was marked as outdated.

@sylvestre
sylvestre force-pushed the fix/15583-split-verbose-n branch from eec73fc to c07dc66 Compare November 1, 2026 18:11
@xtqqczze

xtqqczze commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

@fixfon
fixfon force-pushed the fix/15583-split-verbose-n branch from c07dc66 to e3de964 Compare November 8, 2026 14:55
@fixfon

fixfon commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@xtqqczze I've addressed your review in e3de964 and CI is green now. Could you take another look when you get a chance?

--verbose announced the output files for -b, -l and -C but not for any
--number mode, because the files are opened through OutFiles, which never
called print_creating_file. Announce each file once, right before it is
first opened, whether OutFiles opens it up front or lazily (-e). Kth-chunk
modes write to stdout and still print nothing.

Fixes uutils#15583
@sylvestre
sylvestre force-pushed the fix/15583-split-verbose-n branch from e3de964 to 5a68ed7 Compare November 11, 2026 13:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

split: --verbose prints nothing with -n/--number

2 participants