maximusfz

导航

管道学习手记

1

     int ret, myPipe[2];
     char buffer[MAX_LINE+1];

     /**//* 建立管道 */
     ret = pipe( myPipe );

 /**//* 将消息写入管道 */
 write( myPipe[1], string, strlen(string) );

 

 /**//* 从管道读取消息 */
 ret = read( myPipe[0], buffer, MAX_LINE );

posted on 2010-11-12 14:12  maximusfz  阅读(150)  评论(0)    收藏  举报