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

how to read chunks from named pipe in bash

i have a command that potentially outputs a lot of data to stdout and I need to upload that via ftp to a remote location. I found this question Upload output of a program directly to a remote file by ftp and I really liked the idea of redirecting…
user3347114
  • 175
  • 7
1
vote
1 answer

How to get remaining buffer size of a Named Pipe(FIFO) in linux

In my application I am using Linux Named Pipe for a streaming data transfer. One application(app1) writes stream data to this FIFO, and other application(app2) reads from it. When FIFO size is full, partial record will be written out to FIFO from…
Nomad
  • 751
  • 4
  • 13
  • 34
1
vote
1 answer

Cleaning/flushing of named pipe

I create FIFO to communicate between unrelated processes. In my project there is no way to break infinite loop in which the program runs. So, I can't unlink the FIFO. I thought that I could remove and recreate with same name if the FIFO exist…
1
vote
1 answer

Easy way to pipe data between processes outside of main pipeline in bash

I want to be able to pipe data between processes in an existing bash pipeline. To illustrate better what I mean, take this trivial example, where I assume that file descriptor 3 is acting like a fifo. seq 5 | tee >(while read num; do echo $(($num *…
Erik
  • 6,470
  • 5
  • 36
  • 37
1
vote
2 answers

FIFO block program until other process read

I am using a FIFO file, created as mkfifo myFIFO on Linux terminal, in a C++ code bellow: #include using namespace std; #include int main(int argc, char** argv) { FILE* fp = fopen("/tmp/myFIFO", "w"); fprintf(fp,…
hildogjr
  • 754
  • 2
  • 6
  • 17
1
vote
1 answer

linux FIFO block on read

I'm doing exercise net0 on https://exploit-exercises.com/protostar/. The content of the exercise is to send requested number as a little endian 32bit int to the server. I came up with the following command lines. mkfifo /tmp/pipe cat /tmp/pipe |…
dcnh35
  • 354
  • 2
  • 13
1
vote
1 answer

Determine who is listening on fifo named pipe

Say I have a named pipe: mypipe="foobar" mkfifo $mypipe ... later on say I want to write to it echo "foo" > $mypipe if nobody is listening, I am pretty certain this echo call just hangs. Is there a way to determine if anyone is reading from the…
user7898461
1
vote
0 answers

bufio.Reader not getting EOF on Darwin FIFO

I have a GoLang package that is reading and writing from a fifo using os.OpenFile and bufio.Reader. On Linux the reader is informed that the writer has closed the file. However, on Darwin it never receives the EOF. package main import ( …
St. John Johnson
  • 6,590
  • 7
  • 35
  • 56
1
vote
1 answer

Streaming video using a non-blocking FIFO in linux/bash

I am trying to accomplish the following objectives: Write video from my Raspberry Pi Camera to disk without any interference from streaming Stream the same video through the network optimizing latency It is important streaming does not interfere…
gstorto
  • 165
  • 8
1
vote
0 answers

make fifo pipe in java(windows), write some data into it, let other process read the pipe

My objective is to create a named pipe(fifo) in windows(java), write some data(coming from camera) into that and invoke ffmpeg command to make mp4 from that data. But I suspect that it is not opening a fifo pipe, rather it is opening a file. How can…
sourav
  • 113
  • 2
  • 15
1
vote
0 answers

How to call a terminal command within Python and retrieve resultant file from RAM in same script?

I'm trying to use the sox terminal package in Linux to create a spectrogram png and display it in a GUI using Python. As I will need to use a sequence of images, I'm ultimately planning to implement this in a multiprocessing.Manager|Queue…
cate
  • 600
  • 7
  • 15
1
vote
2 answers

Why does opening a fifo pipe in node block child_process.exec?

When I run this in bash: mkfifo im-a-pipe && node -e ' var fs = require("fs") var childProcess = require("child_process") console.log("pre-open") fs.open("im-a-pipe", "w", function(err, fd){ if(err) throw…
1
vote
1 answer

What are the ways to deal with unix fifos using libuv?

I have an application that for some complex reasons can communicate only using unix fifos (the ones created via mkfifo) Generally, I deal with it like an ordinary file, but if possible, I would like to be able to use it in an asynchronous way. I'm…
hl037_
  • 3,520
  • 1
  • 27
  • 58
1
vote
1 answer

Reader-process termination on FIFO-file closing

I've written a simple reader-writer pair of programs. Writer creates/opens a FIFO-file and is constantly writing a string into it. The reader is just reading it and writing to stdout. The reader does so only for 10 times and then quits. Surprisingly…
daniel.kish
  • 95
  • 1
  • 10
1
vote
1 answer

Where does named pipe (FIFO) data go when reader disconnects?

Let's say I have a producer.go and consumer.go. The consumer.go reads from a UNIX named pipe, and the producer writes to the named pipe. As expected, If you start up just one of the producer or consumer programs, it hangs because there's no reader…
Scott Frazer
  • 2,145
  • 2
  • 23
  • 36