Questions tagged [fifo]
Questions about FIFO - first-in first-out special file, also known named pipe
260 questions
3
votes
1
answer
443
views
Understanding file descriptors and pipes resulting from `cat <(<command>)`
I don't understand the following:
$ cat <(sleep 60) & jobs -l
[1] 63813
[1]+ 63813 Running cat <(sleep 60) &
/proc/63799/fd$ ps --forest
PID TTY TIME CMD
...
4
votes
1
answer
237
views
Why SIGTSTP (^Z/Ctrl-Z/suspend) doesn't work when process blocked redirecting write into a FIFO/pipe not open for reading yet? And what to do then?
Sometimes, a command is stalled attempting to write to a FIFO/pipe that no other process is currently reading from, but typing Ctrl-Z to put the process to the background by sending it the SIGTSTP ...
-1
votes
1
answer
100
views
Serving a file (e.g. in Apache) from a named pipe (made with mkfifo)
Let's say I use Apache, and that I am in /var/www/html/. I do:
mkfifo test.tar
tar cvf - ~/test/* > test.tar &
In a browser, when trying to download http://localhost/test.tar I get:
...
0
votes
2
answers
99
views
when opening a FIFO for reading+writing, and blocking - how to tell if other side opened for reading or writing?
If I open a fifo for reading+writing in blocking mode:
fd = open("foo", "O_RDWR");
Then it blocks until someone on the other end opens it for either reading or writing. But how do ...
0
votes
2
answers
148
views
Split named pipe into two ends: One read only, one write only
I'm trying to set up some inter-process communication, and as a first idea I want to use a named pipe to forward messages from one process to the other. The thing I'm getting stuck on is ensuring that ...
3
votes
1
answer
816
views
Using make variable in bash scripting as part of a makefile command
I've created a makefile command to automate a publishing workflow using Pandoc and the Generic Preprocessor (GPP). It is as follows:
TODAY = $(shell date +'%Y%m%d-%H%M')
MACROS = utils/gpp/macros.md
...
0
votes
1
answer
131
views
How can I make writes to named pipe block if the reader closes, and vice versa?
Right now if I write to a name pipe and then close the reader, the writer gets a SIGPIPE and then exits. For example,
$ mkfifo pipe
$ cat pipe & # read from the pipe in the background
$ cat > ...
0
votes
3
answers
110
views
Terminal hangs while writing into a FIFO file [closed]
I have a program running under a systemd service and I'd like to pass some text/commands to it, so I tried doing so with a FIFO file:
.service file
[Unit]
Description=A Minecraft server service!
[...
1
vote
1
answer
101
views
How to keep a pipe open and discard data while the reader is blocked?
I have a camera capture program and video streaming program working together as rpicam-vid ... | go2rtc. My problem is that go2rtc only reads data from the pipe when someone opens the video stream, ...
0
votes
2
answers
81
views
Difference in bash output redirections behavior
I am trying to understand the reason behind the difference in redirections of bash output. Here are two approaches:
Redirection of the output to named pipe: /bin/bash -i 2>&1 1>/tmp/fifo
...
-1
votes
3
answers
234
views
Empty named pipe
I try to create a named pipe, however, when I store data in it, it is still empty.
$ mkfifo myfifo
$ cat > myfifo
123
123
123
^[[D
^C
$ ls > myfifo
^C
$ cat < myfifo
(no output)
0
votes
1
answer
101
views
Evaluating exit code of pipe or fifo
So i have something along the lines of:
set -eo pipefail
ssh localhost "ls; exit 1" | cat > output
I thought pipefail would prevent cat to write to ouput (because of the exit code from ...
2
votes
2
answers
412
views
Finding the processes trying to open some FIFO
In my example, the wc program is trying to open the test FIFO or named pipe.
These in-progress open syscalls seem not to be shown by fuser or lsof:
mknod /tmp/testpipe p
wc /tmp/testpipe &
timeout ...
1
vote
0
answers
253
views
Redirecting fifo to python's stdin
$ mkfifo mypipe
$ echo "hello redirection" > mypipe
$ cat < mypipe
hello redirection
I have problems when I try to do the above with python
# pyecho.py
with open("/dev/stdin"...
0
votes
0
answers
120
views
What makes named pipes special as compared to regular files? [duplicate]
Take this:
in one terminal,
touch myfile
echo some text >> myfile
# returns straight away
in another terminal,
cat myfile
# prints "some text"
now I can rm myfile
Now this:
in one ...