【问题标题】:convert Ruby to C languge, Would anyone care to take a look?将 Ruby 转换为 C 语言,有人愿意看一下吗?
【发布时间】:2010-04-26 09:40:56
【问题描述】:

我看过这个用 Ruby 代码编写的示例,我如何用 C 语言模拟它?

  Open3.popen3(command) do |stdin, stdout, stderr|
      @stop_stdin = stdin
      while !stdout.eof do 
        output = stdout.read(1024 * 100)
        list_pipes.each do |out|
          out.print output
        end
      end
    end

【问题讨论】:

标签: c ruby popen


【解决方案1】:

弹出的手册页有一个应该有帮助的示例:

http://www.opengroup.org/onlinepubs/009695399/functions/popen.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-30
    • 2021-10-15
    • 1970-01-01
    • 2021-02-20
    • 1970-01-01
    • 2018-02-15
    • 2014-06-07
    相关资源
    最近更新 更多