We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The basic example says
# ...or pass an IO process.io.stdout = Tempfile.new("child-output")
This sounds like a StringIO should work. But
StringIO
irb(main):001:0> p = ChildProcess.build("ls") => #<ChildProcess::Unix::PosixSpawnProcess:0x000055e6766ab500 @args=["ls"], @started=false, @exit_code=nil, @io=nil, @cwd=nil, @detach=false, @dupl... irb(main):002:0> p.io.stdout = StringIO.new Traceback (most recent call last): 1: from (irb):2 ArgumentError (expected #<StringIO:0x000055e6799b3448> to respond to :to_io)
The text was updated successfully, but these errors were encountered:
This may still be an issue, but since #175 made a lot of low-level changes, this may have been resolved.
If you're still seeing this problem, feel free to open a new issue. Thanks!
Sorry, something went wrong.
It's not possible to spawn a subprocess and have it write directly to a StringIO:
> system 'uname', out: StringIO.new (irb):6:in `system': wrong exec redirect action (ArgumentError)
So this cannot be supported directly.
If you need it you can write to a Tempfile, wait the process, copy from the tempfile to the StringIO or whatever, and close the Tempfile.
No branches or pull requests
The basic example says
This sounds like a
StringIO
should work. ButThe text was updated successfully, but these errors were encountered: