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
1 answer

why the command 'exec' can remove the blocking state of fifo file?

I'am studying how to use multi thread to process tasks.And i noticed that the fifo file can help that.here is the effect: #!/bin/bash my_cmd(){ echo "process $1" sleep 3 } ff="d:/myfifo/$$.fifo" mkfifo $ff exec 7<>$ff for i in {1..10};do echo;done…
zadaji
  • 141
  • 6
0
votes
2 answers

Is there a function like WaitNamedPipe or a way to realize this on C++/linux? (so the process is not blocking on the pipe for infinite time)

I have a named pipe in my C++ program. A childprocess writes a value in it and the parent process reads it. I created the pipe by mkfifo and all operations are blocking (fifo cannot be opened for reading before it is tried to open for writing and…
Lin
  • 1
0
votes
0 answers

Reading multiple times from netcat /w named pipe

I have a netcat listener, which responds to "ping" with a SHA1 hash: $ nc localhost 1234 ping da4b9237bacccdf19c0760cab7aec4a8359010b0 And I'm trying to send this via a bash script #!/usr/bin/env bash set -euxo pipefail cd /tmp rm f ||…
Paku
  • 455
  • 1
  • 4
  • 15
0
votes
1 answer

Sending video stream from NodeJS to python in real time

I'm using a NodeJS server to catch a video stream through a WebRTC PeerConnection and I need to send it to a python script. I use NodeJS mainly because it's easy to use WebRTC in it and the package 'wrtc' supports RTCVideoSink and python's aiortc…
0
votes
0 answers

How to make server process wait for second read() from FIFO?

My server and client are communicating back and forth using two named pipes (fifo) in C until the server receives an exit message. Apparently the server side blocks the second time it tries to read() from its FIFO despite the client writing to it…
Lois2B
  • 111
  • 1
  • 16
0
votes
1 answer

python fifo block on a write until read

How to block on last write until other program read the fifo ? import os fn='/tmp/fifo' try: os.mkfifo(fn) except FileExistsError as e: print(fn,e) f=os.open(fn, os.O_SYNC | os.O_CREAT | os.O_RDWR) os.write(f, r) # how to block on…
CS QGB
  • 297
  • 1
  • 3
  • 12
0
votes
1 answer

Segmentation fault (core dumped) with FIFO pipes and fork communication between server and client

I'm writing a project where you start the server in one terminal, and in other terminals that are clients you can send messages from one user to another using FIFO pipes. Server creates FIFO pipe that reads messages from clients. Client creates FIFO…
Invirs
  • 13
  • 3
0
votes
1 answer

How can my C++ program wait until a new write has been made to the named pipe?

I have two separate programs in C++, one that writes to two named pipes in unpredictable intervals and one that should wait to read new content from the pipes whenever available. For simplicity, here my writer only writes two times to the pipes…
vivi22
  • 1
0
votes
1 answer

Python read JSON from named pipe/FIFO

I'm trying to read JSON data from a FIFO as in the code below: import os import errno import json FIFO = '/tmp/vision' try: os.mkfifo(FIFO) except OSError as oe: if oe.errno != errno.EEXIST: raise print("Opening FIFO...") while…
user8401835
0
votes
0 answers

Pass the display of the system () function to a fifo

I want to pass the display of the execution of the system () function in a fifo to be able to display it on another terminal, I tried a but it gives me a segmentation fault void executeFile(char* sourcefname,struct Info_FIFO_Transaction donnees){ …
essayator
  • 18
  • 5
0
votes
1 answer

Writing and reading named pipes

I want to write and read from pipes . I have written a code in C it is compiled successfully but when i run it by ./write it has runtime error . Here are my read and write…
0
votes
1 answer

mkfifo don't make a FIFO special file

when i compile my program it does not create a fifo type file, yet i change the permission, but still nothing I also changed files but still nothing, the code compiles without problem, however when I run then I check if the fifo file is generated,…
essayator
  • 18
  • 5
0
votes
1 answer

Writing from multiple processes launched via xargs to the same fifo pipe causes lines to miss

I have a script where I parallelize job execution while monitoring the progress. I do this using xargs and a named fifo pipe. My problem is that I while xargs performs well, some lines written to the pipe are lost. Any idea what the problem is? For…
Sebastian Barth
  • 4,079
  • 7
  • 40
  • 59
0
votes
1 answer

Read from n pipes from one process in parallel

I faced a concurrency problem when writing to the same named pipe created with mkfifo by multiple processes at the same time, where some writes got lost. Since the number of writing processes are limited I want to switch from "writing to 1 pipe from…
Sebastian Barth
  • 4,079
  • 7
  • 40
  • 59
0
votes
0 answers

C - multiple instances of same child ID (fork and fifo)

I'm trying to implement a program that forks multiple times. The resulting child processes should send their IDs to another program, the receiver program, which should then proceed to kill them one by one. This is the main program: int main() { …
Kyle Sanchez
  • 161
  • 1
  • 2
  • 9