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
2
votes
2 answers

mkfifo causes terminal to hang?

Does mkfifo simply not work with Cygwin? A simple set of commands such as $ mkfifo my_pipe $ echo "1234" > my_pipe just causes the terminal to sit forever with the cursor blinking. Am I "doing it wrong"?
Zombo
  • 1
  • 62
  • 391
  • 407
1
vote
1 answer

Why process that should read from FIFO is stuck at read() while another process is successfully (it seems) writing on it?

This is the interested portion of my code (semplified because it's a bit of a mess): archive.c: int main(int argc, char* argv[]) { pthread_t* thread_tid; pthread_create(&thread_tid, NULL, wthread_boss_body, NULL); …
Borbi
  • 25
  • 5
1
vote
0 answers

ffmpeg: "Input/output error" Read gif from named pipe?

I've been trying to debug this for hours now, and cannot seem to understand why it doesn't work. I want to overlay a png onto all frames of a gif, and since writing all the files to disk is slow, i wanted to use pipes. I created a named pipe using…
Xirado
  • 11
  • 2
1
vote
2 answers

Undefined behavior when reading from FIFO

I am trying to send data from javascript to C via a named pipe/FIFO. Everything seems to be working other than every couple messages there will be an additional iteration of the loop reading 0 bytes rather than the expected 256. I realize I could…
akremer
  • 123
  • 1
  • 1
  • 5
1
vote
2 answers

Process writing to pipe does not terminate until output is consumed

I want to use a pipe with mkfifo to capture all output from several processes running concurrently, roughly like the following PIPENAME="/tmp/foo" echo "Make ${PIPENAME:?}" && mkfifo "${PIPENAME:?}" echo "hello 1" >"${PIPENAME:?}" & echo "hello 2"…
giik
  • 117
  • 6
1
vote
0 answers

FIFO Communication between 2 different applications in C in Linux

I have been trying to write a mechanism for communication between 2 different applications, one called server and the other client, that I launch separately in 2 terminals. I decided on using FIFO files, and the problem that I have encountered is…
HelpMePLs
  • 55
  • 1
  • 5
1
vote
1 answer

How can I keep a FIFO open for reading?

I'm trying to redirect a program's stdin and stdout. I'm currently experimenting with a bash mockup of this, but I'm getting some odd behavior. I have the following: mkfifo in mkfifo out I also have the following script, test.sh #!/bin/bash while…
Maxthecat
  • 1,250
  • 17
  • 37
1
vote
0 answers

equivalent to 'os.mkfifo()' in python

I have a script that I need to translate from unix to windows. The script uses the 'os.mkfifo()' method to create a named pipe. This function is not available under windows. I have found the 'os.pipe()' method, but it doesn't allow to specify a…
iHnR
  • 125
  • 7
1
vote
0 answers

Artifacts in ffmpeg fifo, low fps, stream ends

I'm using a Raspberry Pi 3B and 4 for this, neither works. I'm trying to both pass my capture card's input (/dev/video0) through a fifo file so I can play it on the screen via omxplayer (1080p/30fps), and also grab frames of /dev/video0 out to a…
Ben Gardner
  • 121
  • 1
  • 13
1
vote
1 answer

QSocketNotifier opened on a FIFO keeps firing even if I read everything

In my code I open a FIFO (created with mkfifo) and then I proceed to use a QSocketNotifier to receive notifications of incoming data, to read it while it arrives. // create the FIFO if(!mkfifo(SERIAL_FIFO, 0600)) { // nonblocking open (even open…
Matteo Italia
  • 123,740
  • 17
  • 206
  • 299
1
vote
0 answers

C++/Python Processes IPC with FIFO: Can't read twice in a row from Python

I'm having issues trying to make a C++ process communicate with a Python one through FIFO. These processes use a 2 way communication through 2 FIFOs: the C++ writes on pythonread_fifo and viceversa the Python reads from it the Python process writes…
someCoder
  • 185
  • 3
  • 15
1
vote
3 answers

fifo: Unblock pending open calls

I use a FIFO (named pipe) for IPC. Now process A calls mkfifo(path) open(path) Naturally open() will block until the file is written to by process B. Now I need a way to invalidate a FIFO. Therefore I call unlink(path) Now I expected that any…
user187676
1
vote
1 answer

how to change vlc's input to a fifo

I have a program that open a video.m4v and send it to a fifo. I want to play this video through fifo using vlc but i can't and of course I'm new to vlc this is my program which open the video.m4v and send it to a fifo: int main(){ char…
milad
  • 1,854
  • 2
  • 11
  • 27
1
vote
0 answers

How to set the FIFO size maximum in C?

I create a named pipe with mkfifo(2) . But I want to set its size to maximum. I use fnctl() and PIPE_BUF but I think I couldn't do that. This is my piece of code: #define PIPE_BUF 1048576 #define _GNU_SOURCE int writeSomeStuffToFifo (){ int…
javac
  • 441
  • 4
  • 20
1
vote
0 answers

How do we find out the process ID of the process, reading a named pipe/ FIFO in LINUX?

I have a FIFO/named pipe, which is opened for writing. fd = open(FILE_PATH, O_WRONLY | O_CREAT, (mode_t) 0600); As soon as another process opens the pipe for reading, I want to find out the process ID of the reading process. What is the best way to…