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

FIFO Pipelining Server only receiving certain amount

So I'm trying to implement a basic FIFO pipeline in C using mkfifo(). Here are my code classes so far: main.c: int main(int argc, char *argv[]) { char *path = "/tmp/fifo"; pid_t pid; setlinebuf(stdout); unlink(path); mkfifo(path, 0600); pid =…
keenns
  • 863
  • 4
  • 14
  • 26
0
votes
1 answer

Wait() causing program to pause when opening FIFO named pipe

My code is pausing on open() whenever I use the wait function, and without it the programs dont work. There is no error code but I would like to know whats wrong. The code will eventually be controller.c will open c1,c2,c3. Where it will wait for c1…
Anthony Drury
  • 128
  • 2
  • 12
0
votes
3 answers

What does mode_t 0760 mean?

I start today studying named pipe. I read that to create new named pipe i have to use this function: mkfifo (const char* nom, **mode_t mode**); example: if (mkfifo(("essai.fifo"), **0760**) == -1) { fprintf(stderr, "Can't create…
Style5000
  • 33
  • 8
0
votes
1 answer

Named pipes for client server implementation-How will server distinguish between two request from the same client

I have tried to implement client server model using named pipe. Now when client sends only one message to server the server is able to identify what was the message sent and prints it out. Now if client sends multiple message to same server, the…
Kunal
  • 55
  • 7
0
votes
1 answer

C can't read from fifo (named pipe)

I create a fifo, but i can't read from it. What's the problem? Here is a code and output. If I use O_RDONLY without O_NONBLOCK program just wait. pid_t p; int fd; char str[]="sample"; mkfifo("myfifo", S_IRUSR | S_IWUSR); fd = open("myfifo",…
user4612022
0
votes
1 answer

Why mkfifo'ed pipe only updates after ~25 seconds?

I have one program writing to mkfifo created device 7 lines of text data every 3 seconds using printf(). I am trying to read it with cat /path/to/device in another terminal window. But instead of updating every 3 seconds, it will print something…
exebook
  • 32,014
  • 33
  • 141
  • 226
0
votes
2 answers

mkfifo() not able to create file in C

I'm trying to create a named pipe in C, but have not had any success. Here is my code: #define FIFO_NAME "/tmp/myfifo" int main(){ int fd; fd = mkfifo(FIFO_NAME, 0666);//, 0); if(fd<0){ fprintf(stderr,"Error creating fifo\n"); …
vidit jain
  • 493
  • 1
  • 5
  • 13
0
votes
1 answer

why read -n from fifo file will lost data in shell

First I make a fifo mkfifo a.fifo Then I echo something to it echo 1 > a.fifo Open another terminal, and also add sth to it echo 2 > a.fifo Of course, the two are all blocked,then I read from the fifofile read -n1 < a.fifo All are released and I…
Henry
  • 531
  • 3
  • 12
0
votes
1 answer

R set tcpdump output to fifo then variable or connection

How do I save the live streaming output of this command to a variable/connection line-by-line running in a while loop? Something like: netvalue <-system("tcpdump -A -i eth0 port 80 | grep foo") while(T) { ... nvar <- netvalue +…
0
votes
1 answer

Terminal prompt disappears when a named pipe is used

I'm trying to use named pipes in a project. I have two terminals open, Terminal A and Terminal B. In terminal A, I issued this command: mkfifo myFifo && tail -f myFifo | csh -s It seems as if standard out is being redirected somewhere else, though,…
erip
  • 16,374
  • 11
  • 66
  • 121
0
votes
1 answer

do not have the authority to access the file created by mkfifo

While using the FIFO to transmit information between different processes, I found out that the file that the mkfifo create cannot be accessed by the processes. I do not know how to change my program. Please help :( if (mkfifo("signal", O_CREAT)…
0
votes
1 answer

pulling file and zip while pulling in UNIX

I am generating files from netezza server using nzsql. Now the next part of the requirement is to zip and move the file into a different box (a second unix box). I can achieve this sitting in the 1st box (sitting in the first box I am first doing…
Koushik Chandra
  • 1,565
  • 12
  • 37
  • 73
0
votes
1 answer

made fifo file without using mkfifo or mknod

I was trying to stream mp3 music through gnuradio using vlc and mpg123 player. Following this site's example http://www.opendigitalradio.org/Simple_FM_transmitter_using_gnuradio The commands are: $ mkfifo stream_32k.fifo $ mpg123 -r32000 -m -s …
0
votes
1 answer

Give permissions from super user process in mkfifo

I need to create a pipe using mkfifo() from a super user process, that pipe must be writable from a process not super user. Reader: int main () { char *myfifo = "/tmp/myfifo"; int buf; mkfifo(myfifo, 0777); //problem here FILE *fp; fp =…
billi90
  • 35
  • 6
0
votes
1 answer

Reading and writing(at back) simultaneously in a fifo

I'm trying to copy the contents of a file1 into other file2 through fifo. The first four characters I want to write back in the fifo (during reading, not earlier when writing contents from file1 to fifo) and then copy it in the file2 also. But the…
priya_ajju
  • 57
  • 1
  • 8