What’s the best way to capture stdout from a proce...
# development
a
What’s the best way to capture stdout from a process to a file? (I’m looking to concatenate a bunch of files together and store the results, and
cat
seems to only output things to stdout)
h
Using Pants? Or using shell?
a
in pants
h
You would run a
Process
and then pipe
ProcessResult.stdout
into
CreateDigest()
a
It looks like
ProcessResult.stdout
is a string, and not a pipe, which would materialise the results of the process into memory (bad)
I guess I could run
bash -c "cat file1 file2 > outputfile"
h
Oh I think i see what you're asking now. Yeah, and then use
Process(output_files=)
Indeed, you need some way for the process itself to right directly to a file
what is the underlying process?
a
it’s cat
🐈 3
w
yea, use a bash process: grep for
BashBinary
a
Yup, I found BashBinary, just wanted to make sure I wasn’t missing anything