Questions tagged [pipe]
A pipe is an interprocess connection between file descriptors of two processes. A pipe is created with the POSIX pipe() function (from <unistd.h>). Shells create pipes between processes if the "|" symbol is used: "cmd1 | cmd2" directs the output of cmd1 to the input of cmd2. On Windows use CreatePipe(). This mechanism redirects standard input, standard output, and standard error into the calling process in .NET and Java.
10,302
questions
1
vote
1
answer
269
views
Unwanted buffering when filtering console output in Win32
My question is related to "Turn off buffering in pipe" albeit concerning Windows rather than Unix.
I'm writing a Make clone and to stop parallel processes from thrashing each others' console output I'...
3
votes
4
answers
287
views
Need help designing an inter-process comm layer
I have several process in my system that need to communicate with each other.
Some of the processes need to pass chunks of data 60 times per second continuously,
and some are very sporadic.
Most of ...
4
votes
2
answers
4k
views
Start nano as a subprocess from python, capture input
I'm trying to start a text editor (nano) from inside Python, have the user enter text, and then capture the text once they writeout (Control-O). I haven't worked with the subprocess module before, nor ...
2
votes
3
answers
2k
views
Library for Dataflow in C
How can I do dataflow (pipes and filters, stream processing, flow based) in C? And not with UNIX pipes.
I recently came across stream.py.
Streams are iterables with a pipelining mechanism to enable ...
36
votes
4
answers
34k
views
Communicate multiple times with a process without breaking the pipe?
It's not the first time I'm having this problem, and it's really bugging me.
Whenever I open a pipe using the Python subprocess module, I can only communicate with it once, as the documentation ...
22
votes
1
answer
50k
views
Piping to findstr's input
I have a text file with a list of macro names (one per line). My final goal is to get a print of how many times the macro's name appears in the files of the current directory.
The macro's names are ...
36
votes
3
answers
8k
views
Is it OK to use the same input file as output of a piped command?
Consider something like:
cat file | command > file
Is this good practice? Could this overwrite the input file as the same time as we are reading it, or is it always read first in memory then ...
2
votes
2
answers
1k
views
How to create named pipe acsessible Only on your machin? (VS08 C++)
I have created a program that write video stream to a named pipe on windows, using Visual Studio C++ 2008 . how to be sequre that no one exept programms on this computer can acsess this pipe?
...
0
votes
1
answer
502
views
How to create PIPE accessible from remote computers in .NET 4.0?
How to create PIPE accessible from remote computers in .NET 4.0? And how to access it?
44
votes
6
answers
55k
views
Combining echo and cat on Unix
Really simple question, how do I combine echo and cat in the shell, I'm trying to write the contents of a file into another file with a prepended string?
If /tmp/file looks like this:
this is a test
...
-1
votes
1
answer
960
views
Connect to an existing process
Hole thing is happening on the mac os x.
Let's assume that I've opened an program by clicking on an .app icon. It's a python program with GUI which has a separate process that waits for a user input. ...
2
votes
6
answers
6k
views
C: Fifo between threads, writing and reading strings
Hello once more dear internet,
I am writing a small program that, among other things, writes to a log file all of the commands it received.
To do that, I want to use a thread that will only attempt ...
2
votes
5
answers
3k
views
Capturing exit status from STDIN in Perl
I have a perl script that is run with a command like this:
/path/to/binary/executable | /path/to/perl/script.pl
The script does useful things to the output for the binary file, then exits once STDIN ...
1
vote
1
answer
1k
views
Java Input/Output streams for unnamed pipes created in native code?
Is there a way to easily create Java Input/Output streams for unnamed pipes created in native code?
Motivation: I need my own implementation of the Process class. The native code spawns me a new ...
9
votes
3
answers
7k
views
What does [a|b|c] evaluate to in SWI-Prolog?
The pipe operator in prolog returns one or more atomic Heads and a Tail list.
?- [a,b,c] = [a,b|[c]].
true.
Nesting multiple pipes in a single match can be done similar to this:
?- [a,b,c] = [a|[b|[...