阅读来自同一个C程序的标准输出 [英] Read the stdout from the same C program

查看:97
本文介绍了阅读来自同一个C程序的标准输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从我的程序的标准输出读?

How can I read from the stdout of my program?

我的一个线程需要访问的标准输出读什么其他线程正在登录。

One of my threads needs to access the stdout to read what the other threads are logging.

我使用的是亲爱的老纯C

I'm using the dear old plain C.

推荐答案

请通过标准输出用的pipe 使用 DUP

Make stdout use a pipe by replacing the stdout fd with the write side fd of a pipe using dup.

这篇关于阅读来自同一个C程序的标准输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆