Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <stdio.h>
- #include <unistd.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <signal.h>
- #define _GNU_SOURCE
- #include <string.h>
- #include <errno.h>
- #include <fcntl.h>
- #include <stdbool.h>
- int main(void)
- //void serverPipecreate()
- {
- char fifo_serveur[] ="server";
- char fap[100];
- char command[100];
- int n=-1;
- int fd;
- if ( mkfifo(fifo_serveur ,0644) != 0 )
- {
- perror("mkfifo");
- printf("Erreur ouverture pipe nomme\n");
- exit(1);
- }
- fd = open(fifo_serveur , O_RDWR);
- while (n==-1)
- {
- n = read(fd,fap,100);
- printf("%s\n", fap);
- //printf("J'écoute en serveur\n'");
- }
- unlink(fifo_serveur);
- strcpy(command, fap );
- system(command);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement