Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <stdio.h>
- #include <stdlib.h>
- int main(char *argv[]) {
- mkfifo("PIPE_myFTP",S_IRUSR|S_IWUSR);
- int personne = fork();
- int pidserv=0;
- if (personne ==0) //= Fils
- {
- pidserv = getpid();
- char* args[]={"unServeur.exe",NULL};
- execvp("unServeur.exe",args);
- }
- else
- {
- fork();
- if ( fork() == 0 && getpid() != pidserv)
- {
- char* args[]={pidserv,argv[0],NULL};
- execvp("unClient.exe",args);
- }
- else if (fork() == 0)
- {
- wait();
- wait();
- system('rm PIPE_myFTP')
- kill(getpid());
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement