ChinaUnix.net
相关文章推荐:

pipe函数

pipe(建立管道) 表头文件 #include 定义函数 int pipe(int filedes[2]); 函数说明 pipe()会建立管道,并将文件描述词由参数 filedes 数组返回。 filedes[0]为管道里的读取端,所以pipe用read调用的 filedes[1]则为管道的写入端。 返回值: 若成功则返回零,否则返回-1,错误原因存于 errno 中。 错误代码: EMFILE 进程已用完文件描述词最大量 ENFILE 系统已无文件描述词可用。 EFAULT 参数 filedes 数组...

by iceway - Linux文档专区 - 2008-08-28 13:26:24 阅读(1171) 回复(0)

相关讨论

在下刚刚学Perl,手头马上就有了个棘手的任务,其中对pipe的用法有些疑问: 用Open打开一个pipe open(FILE, "| hets -w \"$_\" >;$fileName 2>;fileName.err"); print FILE "$_"; 其中hets 是在Unix里执行的命令,有 [w] 选项, 输入为从网页上传送来的数据($_ = $ENV{'QUEWY_STRING'};)。 现在hets命令变成不是读String,而是读取某个文件里的内容,请问怎么才能把上面的语句改变?

by clausius - Perl - 2004-06-29 08:39:01 阅读(1547) 回复(1)
by prolj - C/C++ - 2009-11-04 15:19:22 阅读(2959) 回复(1)

好像man不出来?什么系统才提供这个函数? 还有,APUE上的原型: int s_pipe(int fd[2]) { return(pipe(fd)); } pipe不是半双工的吗?为什么说s_pipe是全双工的???十分不解

by lozity - C/C++ - 2008-06-10 20:49:49 阅读(3275) 回复(3)

请问怎么让pipe创建出来的管道文件在用 isatty函数检查时认为是一个TTY??? 例如: int fd[2]; pipe(fd); isatty(fd[0]);//就是让这一行返回TRUE 也就是怎么用管道文件模拟成一个TTY的问题。

by mxwen16 - 程序开发 - 2004-04-20 15:31:20 阅读(959) 回复(0)

请问怎么让pipe创建出来的管道文件在用 isatty函数检查时认为是一个TTY??? 例如: int fd[2]; pipe(fd); isatty(fd[0]);//就是让这一行返回TRUE 也就是怎么用管道文件模拟成一个TTY的问题。

by mxwen16 - Linux环境编程 - 2004-04-20 15:31:20 阅读(1754) 回复(0)

int _pipe( int *phandles, unsigned int psize, int textmode ); 在windows里,调用_pipe函数时psize参数传入0,为什么创建管道也成功并好用? 注:Linux的pipe函数没有psize参数。 int pipe(int filedes[2]); [ 本帖最后由 百度GOOGLE一下 于 2008-10-20 16:49 编辑 ]

by 百度GOOGLE一下 - C/C++ - 2008-10-20 19:26:28 阅读(1637) 回复(1)

mkfifo pipe while read do read inputCmd eval $inputCmd done <pipe 在网上看到一段这样的pipe的code。自己试验了,没有什么结果。 请问shell的pipe有什么作用,可以用temp file代替吗。 shell的pipe和c语言的pipe有什么区别

by fufelixzh - Shell - 2013-01-03 17:58:47 阅读(1273) 回复(3)

/*the parent and child process comminucates through the pipe the child process write data to pipe the parent process read data from pipe */ #include #include #include #include #include #include #include #define BUF_SIZE 511 int main(int argc,char **argv) { char buffer[BUF_SIZE+1]; int fd[2];/*pipe file descriptor*/ if(argc!=2) { fprintf(stderr,"Usage:%s string\n",argv[0]); return 0; } /*cr...

by creatory - Linux文档专区 - 2008-12-12 19:27:24 阅读(777) 回复(0)

进程间通讯 1 pipe1.c #include stdio.h> #include unistd.h> void main() { FILE * in_file; int count = 1; char buf[80]; in_file = fopen("mypipe", "r"); if (in_file == NULL) { printf("Error in fdopen.\n"); exit(1); } while ((count = fread(buf, 1, 80, in_file)) > 0) printf("received from pipe: %s\n", buf); fclose(in_file); } ...

by tdh2002 - Linux文档专区 - 2010-02-02 17:13:46 阅读(875) 回复(0)

弄Sql Server好半天了,sqlcmd通过named pipe就是连不上,具体查查它到底是干什么的。 在Win32下提供的进程间通信方式有以下几种: 剪贴板Clipboard:在16位时代常使用的方式,CWnd类中提供了支持。 COM/DCOM:通过COM系统的代理存根方式进行进程间数据交换,但只能够表现在对接口函数的调用时传送数据,通过DCOM可以在不同主机间传送数据。 Dynamic Data Exchange(DDE):在16位时代常使用的方式。 File ...

by zrl1986 - 网络技术文档中心 - 2008-04-18 17:06:55 阅读(897) 回复(0)