pipe

    0热度

    1回答

    下面是程序: int fd[2]; char buf1 [31]; int i; char buf2; pipe(fd); if (fork() == 0) { // child close(fd[1]); // close writing pipe for(i = 0; i< 20; i++) { read(f

    0热度

    1回答

    当我在gdb中运行时,父进程在waitpid处挂起,我不知道为什么。父母应该从argv获取参数并通过管道将其发送给孩子。然后,父母应该通过返回来接收来自孩子的参数的总和。不知道为什么它这样做。 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/wait.h> #include <sys/poll

    1热度

    1回答

    如何使用asyncio在两个协程之间实现管道,一个从流中读取,另一个写入其中? 假设我们有这个现有的代码,两个简单的脚本。一个产生到stdout: # produce.py import asyncio import random import sys async def produce(stdout): for i in range(10000): await

    2热度

    1回答

    我有一个工具,它生成一些数据并将其输出到stdout。 在我的Perl脚本中,我需要启动这个工具,并使用Post请求将生成的数据发送到http服务器。该工具会生成大量数据,并且将其保存在磁盘上可能非常耗时并且只能发送它。所以我真的想发送它,让我们说重定向标准输出到http post请求。 内容长度不应该是一个大问题,因为我知道数据大小。 我已经尝试过使用回调: my @chunk = qw(foo

    0热度

    2回答

    我有两个进程:​​和t2.cpp。 ​​和t2.cpp被简化了,我想很容易地描述这个问题。 //t1.cpp #include <iostream> using namespace std; int main() { cout << "hello\n" << "world\n" << "ok ok\n"; return 0; } //t2.

    0热度

    1回答

    我正在使用child_process spawn为其标准输入创建进程和管道输入。 不过,我不,直到我做了 child.stdin.end() 得到任何.on('data', ...事件但这将关闭管道进行进一步的输入。 unhandledRejection Error: write after end 那么,有没有办法要么 力数据得到刷新到标准输出 重新打开孩子管stdin.end后,标准输

    0热度

    2回答

    我正在使用货币管道,但不知道如何设置右对齐/左对齐。如果货币是美元显示正确结果,但是如果我使用INR显示错误结果。 HTML: - <div> {{amount | currency : 'USD' : true}} </div> <div> {{amount | currency : 'INR' : true}} </div> TS: - amount = 100; 输出: - $10

    0热度

    1回答

    目前我面临转换FirebaseListObservable与我的Ionic 2应用程序的注释问题。 火力地堡里面的结构是 - commentkey -- userID -- message -- Timestamp 我收到了从可观察和火力与 <div *ngFor="let comment of comments | async"> <div ion-item>

    0热度

    2回答

    如何在Python 2.7中运行这个linux命令? tail -f *file.log | grep 10.10.10.100 下面似乎没有观察到grep。我看到以前的帖子,但没有看到任何人试图拖尾文件,然后管道grep。 subprocess.call(["tail", "-f", "*files.log", "|", "grep", "10.10.10.100"])

    0热度

    1回答

    假设我有一个程序,说“主”#0,再加上一些奴隶程序#1,#2,#3 ...,它们的工作方式是#n的输出是通过#n + 1阅读。我得到#0打开一个管道的bash shell这样所有从程序设置,以便(非常像这样的C代码)运行: PROGRAM#0: ... pipe=popen("bash","w"); fprintf(pipe,"./program#1 \n"); fprintf(pipe,"