这一特性是用popen系统调用实现的,该系统调用允许一个进程打开到另一个进程的管道,将管道用于输出或输入。
This feature is implemented using the popen system call, which allows one process to open a pipe to another process, either for output or input. In this case we open a pipe to the command.
为了写日志给一个管道,简单地用管道符|替换文件名,跟随可执行程序名字,这个程序应该在它的标准输入上接受日志项。
In order to write logs to a pipe, simply replace the filename with the pipe character "|", followed by the name of the executable which should accept log entries on its standard input.
应用推荐