-
Notifications
You must be signed in to change notification settings - Fork 2.1k
save should stream data whenever possible #7590
Copy link
Copy link
Closed
Labels
A:streamingIssues related to streaming data (or collecting data when it should be streamed)Issues related to streaming data (or collecting data when it should be streamed)category:enhancementNew feature or requestNew feature or request
Milestone
Description
Related problem
save collects input data in a few situations where it doesn't always need to:
nushell/crates/nu-command/src/filesystem/save.rs
Lines 151 to 153 in 3d682fe
| output.into_value(span) | |
| } | |
| None => input.into_value(span), |
| input => match input.into_value(span) { |
Describe the solution you'd like
save should always stream ListStream input into a file instead of attempting to collect it all.
It should be possible to stream to a file slowly:
1..100 | each { |i| sleep 400ms; $i} | save -f output.txtAnd watch individual lines (or batches of lines) arrive with tail --follow in another shell:
tail --follow output.txtAdditional context and details
Hat tip to this comment: #6178 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:streamingIssues related to streaming data (or collecting data when it should be streamed)Issues related to streaming data (or collecting data when it should be streamed)category:enhancementNew feature or requestNew feature or request