Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Name pipe
#include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/types.h> #include <sys/uio.h> #include <unistd.h> #define MAX_LINE_LENGTH int main(int argc, char *argv[]) { int pipe; char ch; /* we expect a named pipe has been created * in /tmp/named_pipe . The command * $ mkfifo /tmp/named_pipe * is a friend to get to this point */ pipe = open("/tmp/named_pipe", O_RDONLY); if (pipe < 0) { perror("Opening pipe"); exit(1); } /* preparing to read from the pipe... */ printf("Waiting data from the pipe... \n"); /* reading one char a time from the pipe */ while (1) { if (read(pipe, &ch, 1) < 0) { perror("Read the pipe"); exit(2); } printf("%c", ch); } /* leaving the pipe */ close(pipe);
run
|
edit
|
history
|
help
0
program1
Max3
Lab 7 blackjack v0.6
exercises
B_14118_RestasSucesivas
a1
lab6
A_141205_Palindromo
AVANCE DE PREGUNTA 5
My first 2D array