从system(3)调用中提取输出 [英] Extracting output from system(3) call

查看:84
本文介绍了从system(3)调用中提取输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有标准方法从system(3)函数中提取输出?

TIA。

is there any standard way to extract output from system(3) function?
TIA.

推荐答案

如果可能的话使用pipe(2)如何从文件指针FILE *派生文件描述符

。 TIA。

if possible to use pipe(2) how could file descriptor can be derived
from file pointer, FILE *. TIA.


我将使用


system(" ls> / tmp / t") ;

am going to use

system("ls > /tmp/t");


v4vijayakumar写道:
v4vijayakumar wrote:
有没有任何标准方法从system(3)函数中提取输出?
TIA。
is there any standard way to extract output from system(3) function?
TIA.




< OT>

在Posix系统中,使用popen(3)代替

< ; / OT>


Robert



<OT>
In a Posix system, use popen(3) instead
</OT>

Robert


这篇关于从system(3)调用中提取输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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