繁体   English   中英

如何隐藏来自 execlp C/C++ 的终端 output

[英]how to hide terminal output which comes from the execlp C/C++

fork_rv = fork();
if (fork_rv == 0)
{
    // we're in the child
    chdir(view.path);
    execlp("xdg-open", "xdg-open", FOCUSED.name, NULL);

    // in case execl fails
    _exit(1);
}

这部分代码在 curses 应用程序中运行,我不想显示 function execlp 的 output 因为它覆盖了我的应用程序输出
我该如何隐藏它

fork_rv = fork();
if (fork_rv == 0)
{
    // we're in the child
    chdir(view.path);
    execlp("xdg-open", "xdg-open", FOCUSED.name, NULL);

    // in case execl fails
    _exit(1);
}

这部分代码在 curses 应用程序中运行,我不想显示 function execlp 的 output 因为它覆盖了我的应用程序输出
我该如何隐藏它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM