Created
July 3, 2021 18:55
-
-
Save eginez/27946ca622cd2b6553bbd9d0dacdb58d to your computer and use it in GitHub Desktop.
Julia read stdout of proc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
out = Pipe() | |
p = run(pipeline(`top`, stdout=out), wait=false) | |
## Now p is running in the background | |
## You can read out | |
output = String(read(out, 1024)) ## read() reads until eof, which is not what I need. | |
line = readline(out) | |
kill(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment