Repository navigation
split: add -u/--unbuffered - #16375
Conversation
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
|
GNU testsuite comparison: |
|
thanks for looking into this! |
| @@ -2566,6 +2566,32 @@ fn test_number_with_plus_prefix( | |||
| assert_eq!(files, expected_files, "-n {number}"); | |||
There was a problem hiding this comment.
this gives the same output with or without -u. Could you please add a case with records longer than the buffer (---io-blksize=2)? That is where record_complete matters.
There was a problem hiding this comment.
Added test_unbuffered_record_longer_than_buffer with ---io-blksize=2, to files and with r/K/N. It fails if the chunk number moves on after a partial record.
|
The CodSpeed one is About squashing: would a squash merge work for you? Otherwise I can squash before it goes in. |
e0ee58e to
09de443
Compare
|
Squashed into one commit; the only change is a reworded test comment. |
b6ed3c1 to
66eba4d
Compare
With -n r/..., pass the input on as soon as it is read instead of one whole record at a time, and flush stdout after each write for r/K/N. In the other modes the option is accepted and changes nothing.
66eba4d to
31afabc
Compare
# Conflicts: # src/uu/split/src/split.rs
|
Thanks for your PR |
GNU split has
-u/--unbuffered("immediately copy input to output with '-n r/...'"). We rejected it as an unknown argument.Output files and filters are already written without buffering, so the only modes it changes are
-n r/...:(printf ab; sleep 2; printf 'c\n') | split -u -n r/1/1theabshows up right away, as with GNU;r/K/N, stdout is flushed after each write (it is line buffered, which does nothing with-t).In the other modes it is accepted and does nothing, like GNU.