Questions tagged [mkfifo]

Creates a named-pipe (aka FIFO)

A named pipe, also called a FIFO for its behaviour, can be used to connect two unrelated processes and exists independently of the processes; meaning it can exist even if no one is using it. A FIFO is created using the mkfifo() library function.


What is considered related processes?

Probably processes which are related via one or more parent/child relations (e.g. includes siblings). The common ancestor would have created the two ends of the pipe. Unrelated processes lack that common ancestor.

229 questions
0
votes
0 answers

Reattach to a running process to read the standard output in Windows with named pipe

I want to start a random child process and let it run even if the parent process exit later. It should be possible to read the standard output in none-blocking manner from the child process even if the parent has exited. Another proces should be…
0
votes
1 answer

FIFO: One process never reads from pipe

I'm following THIS TutorialsPoint guide to Linux Piping, and I specifically need to use FIFOs. However, the code doesn't work at all for the server side. The server file either hangs indefinitely or it reads nothing, while the client instead writes…
someCoder
  • 185
  • 3
  • 15
0
votes
1 answer

Client reads empty line

My Client.c ask for user input and writes it to the FIFO of the oracle.c called ask.me. While my oracle.c is waiting to read something. If the client writes something,the oracle reads it and writes an answer in the fifo of the client called…
Cryptos90
  • 3
  • 2
0
votes
0 answers

FIFO pipe - Child wont read properly

I try to use two FIFOs, one for the child process and one for the parent. First, the child should write a question in the parent FIFO. Parent waits until question arrives, then reads it, answers it and writes the answer in the child's FIFO. Child…
Cryptos90
  • 3
  • 2
0
votes
1 answer

Named pipes in C program (unix)

I have to use 3 processes in order to solve the problem. First processes gets input from (entered via keyboard) and sends it to the second procces The second process replaces all the vocals from the text with 12345 (a with 1, e with 2, ...). I got a…
rares04
  • 11
  • 2
0
votes
0 answers

How do I set up nonblocking named pipes on Linux using C?

I have 3 processes and two pipes. Process Producer generates a character and sends it to process Buffer via the Input pipe. Process Buffer stores the data in an array, then sends it to process Consumer via the Output pipe. Consumer then prints the…
Ploof
  • 17
  • 6
0
votes
1 answer

On the consumer-end of a named pipe (FIFO), is there a way to distinguish each item and redirect it to its own processes?

The best I can explain is by example. Create named pipe: mkfifo pipe Create 5 text files, a.txt, b.txt, c.txt, d.txt, e.txt (they can hold any contents for this example) cat [a-e].txt > pipe Of course, because the pipe is not open at the consumer…
dnk8n
  • 675
  • 8
  • 21
0
votes
0 answers

select() does not work for multiple named pipes

I'm currently trying to implement a chat server/shoutbox via named pipes. The server takes the name of the pipes as a command line argument. It then proceeds with creating the pipes and opens them for reading. The other processes open the pipe for…
Thomas Thaler
  • 55
  • 1
  • 5
0
votes
0 answers

Can not open FIFO for any operations

I write the program and create FIFO. It was created, but I can not open it for any operations. I saw similar questions here can not open FIFO , but actually I didn't understand its answer, but I think I've got something with permissions too. Can…
IWProgrammer
  • 155
  • 1
  • 9
0
votes
1 answer

How to verify that the `mkfifo` call succeed?

I am new to C++ programming and I am trying to use mkfifo command to create a named pipe that I can read from my java program. Here is my code: int main(int, char **) { std::cout << "START" << std::endl; int fd; // FIFO file path …
Vatish Sharma
  • 1,536
  • 3
  • 16
  • 35
0
votes
0 answers

Malfunctioning semaphore

I am trying to organize the interaction of two processes. The first process sends in the second 2 numbers. The second finds the amount and passes it to the first process. I use a named semaphore to synchronize these processes. After creating MKFIFO,…
0
votes
0 answers

Blocking an independent process when transmitting data through a FIFO channel

I have 2 independent processes. I send 2 values to the second process to calculate their amount. This works, but now I need to return the value of the sum to the first process and this does not work anymore because of the lock. The second process is…
0
votes
0 answers

How to send a message from parent process to multiple fork children?

I have a server that allows clients to connect and I am using select() to manage new connections or incoming messages from already connected clients. For every 2 clients connected I create a child using fork(), remembering their file descriptors.I…
0
votes
2 answers

MPlayer infinity loop with pipe

I'd like to use mplayer to play a video in an infinity loop with no interrupts between. So I tryied it with a mkfifo pipe. Like this one here. mkfifo pipe (cat pipe | mplayer -cache 10000 -cache-min 0 -really-quiet - ) & cat video.avi >> pipe …
YANNlK
  • 3
  • 2
0
votes
1 answer

can we perform the operation using functions like fgets(), fputs(), feof(),etc. for the fifo file like we use for the normal file?

I have an assignment where I have to transfer the file from a client process to server process using fifo.I have tried to deal with fifo file as the other files we create in the system. It compiled without any error but it didn't execute…
Natalie
  • 41
  • 5