NoShell:C++ 库可轻松启动子进程和命令管道

时间:2021-07-13 22:58:10
【文件属性】:
文件名称:NoShell:C++ 库可轻松启动子进程和命令管道
文件大小:255KB
文件格式:ZIP
更新时间:2021-07-13 22:58:10
C++ 无壳库 概述 NoShell C++11 库允许在不使用 shell 的情况下使用类似于 shell 的语法轻松启动子进程。 它喜欢使用“ system() ”、“ popen() ”或“ spawn() ”调用,但更易于使用且功能类似于shell。 例如,下面的代码将运行“ grep ”命令和设置的流is从它的标准出到读出。 noshell::istream is; noshell::Exit e = " grep " _C( " -c " , " /proc/cpuinfo " ) | is; int ncpu; is >> ncpu; 现在ncpu包含 Linux 机器上的 CPU 数量。 NoShell 也允许创建命令管道,并进行重定向(使用“<”、“>”、“>>”),就像在 shell 中一样。 例如,以下外壳代码: grep < /proc/cpuinfo | wc -
【文件预览】:
NoShell-master
----Makefile.am(572B)
----.gitignore(5B)
----Tuprules.tup(1KB)
----html()
--------Tupfile(189B)
----doc()
--------README.md(10KB)
----configure.ac(363B)
----ChangeLog(0B)
----COPYING(34KB)
----README.md(3KB)
----tests()
--------test_misc.hpp(728B)
--------test_fd_type.cc(1KB)
--------Tupfile(962B)
--------test_error.cc(2KB)
--------test_pipeline.cc(1KB)
--------test_simple_command.cc(2KB)
--------kill_self.cc(140B)
--------test_literal.cc(507B)
--------test_resources.cc(493B)
--------gtest()
--------test_misc.cc(1KB)
--------check_open_fd.cc(1KB)
--------text_file.txt(18B)
--------test_extra_fds.cc(1KB)
--------test_cmd_redirection.cc(9KB)
--------puts_to.cc(311B)
----include()
--------noshell()
--------noshell.hpp(173B)
----INSTALL(15KB)
----lib()
--------Tupfile(174B)
--------utils.cc(1KB)
--------setters.cc(4KB)
--------noshell.cc(5KB)
----noshell.pc.in(263B)
----README(15B)
----AUTHORS(19B)
----NEWS(0B)

网友评论