Skip to content
New issue

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

使用ruby的popen模块封装后遇到输出堆积的问题 #1

Open
wangzf0225 opened this issue Jun 21, 2017 · 1 comment
Open

使用ruby的popen模块封装后遇到输出堆积的问题 #1

wangzf0225 opened this issue Jun 21, 2017 · 1 comment

Comments

@wangzf0225
Copy link

我使用ruby对phptrace进行了封装,封装后执行phptrace -p all命令,每访问8次php文件,才会出现一次输出,每次输出会将8次执行的结果一起输出。请问是什么原因,应该如何解决?
`
require 'open3'

cmd = 'sh'

Open3.popen2e(cmd) do |stdin, stdout_stderr, wait_thread|
Thread.new do
stdout_stderr.each {|l| puts l }
end

stdin.puts 'phptrace -p all'
stdin.close

wait_thread.value
end
`

@monque monque closed this as completed Apr 13, 2022
@monque
Copy link
Owner

monque commented Apr 13, 2022

@monque monque reopened this Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants