IPC with pipes, demo of 'popen'

#include <stdio.h>
#include <unistd.h> int main()
{
FILE* stream = popen ("sort", "w");
fprintf (stream, "This is a test.\n" );
fprintf (stream, "Hello, world.\n");
fprintf (stream, "My dog has fleas.\n");
fprintf (stream, "This program is great.\n");
fprintf (stream, "One fish, two fish.\n");
return pclose (stream);
}
上一篇:APPIUM安装与搭建Q&A


下一篇:【转】典型的JavaScript面试题