I was reviewing a set of interview questions that are asked from a unix admin; I found a topic called "named pipe".
I googled the topic; to some extent I have been able to understand it :- named pipes || FIFO
But still I feel that I am lacking the knowledge of when to use this particular type of pipe. Are there any special situations where unnamed pipes would fail to work ?
Many (>1000) workers (process) do some and want to save their work results in database. Result of work is JSON object. Workers produce JSON objects 1-5 per second. Database saver is separated process. Unidirectional connections for transfer JSON object from worker to saver is multiprocessing.Pipe.
I created execute.php as follows
Code:
<?php
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w"), // stderr
);
$process=proc_open('/bin/irsend list "" ""',$descriptorspec,$pipes,dirname(__
I'm new to Unix, and just had a quick question.
I'm writing a bash script, and I was wondering what proper programming etiquette was for piping. How many pipes is too many pipes?
Code:
OLDEST=$(find . -maxdepth 1 -type d -newermt 2012-07-01 ! -newermt
2012-07-30 | xargs ls -1td | tail -2)
echo "${OLDEST}\n"
My next step would be to tar those directories, then move them.
Two processes are communicating through a pipe: A | B. A is writing data faster than B is reading it in. Is there any way to have A limit its writing rate to match B's reading rate?
AFAIK the pipe will get full, and will make A's writing block, waiting for B to read in more data.
I have something that I've been staring at for most of the night and can't figure out. I'm writing code in C that is supposed to use pipes to pass a byte back and forth, allowing me to switch between a parent and child process that will take turns writing a string to a file.
I'm writing a short program that's polling the buffer of a named pipe. To test it out, I'll log into 'nobody' and echo into the pipe. while it's hanging, I log in from a different user and run the program that reads the buffer. When it runs, the program returns nothing and the other user is logged out of the system.
I've got some code I'm writing that is expecting messages from a Matlab program via a named pipe, e.g., "/tmp/named_pipe_0". I can get pipes mkfifo and opened find, but when the C program goes to read() from the pipe, instead of the expected 5004 bytes, I'll get short values like 4096, 904, 5000, 4096, etc.
I have a lot of code I need to daemonize that prints to standard out.