feather
feather copied to clipboard
Process/collect hangs on large stdin
I'm trying to run a command that has a very large output and read it into my program, which causes the stdout collector to hang.
How to reproduce
The best example I can give is to try and read in a large file via cat
or less
. (In reality I am invoking a command that outputs this large data, but cat
and less
seem to be a reasonable proxy). In my example the file was about ~350 KiB and was a git diff of a binary file change (i.e. git diff --binary <hash>~ <hash>
).
open Feather
let foo = process "less" [ "large-git-diff.diff" ] |> collect stdout in
print_endline foo;
I think this is a Feather-related issue, since a combination of Unix.open_process_in
and In_channel.input_all
seems to work, but I do enjoy Feather's API more than using raw Unix.
Please let me know if you need more information.