josiftepe

Untitled

Jun 13th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<unistd.h>
  3. #include<fcntl.h>
  4. #include<sys/types.h>
  5. #include<sys/stat.h>
  6. #include<string.h>
  7. int main() {
  8.    char s[100] = "";
  9.    char s1[1000] = "";
  10.    int ff, file1;
  11.    ff = open("fifo1", O_WRONLY);
  12.    file1 = open("fifo2", O_RDONLY);
  13.    printf("\nEnter file name:");
  14.    scanf("%s", s);
  15.    write(ff, s, strlen(s));
  16.    while(read(file1, s1, 1000) != 0) {
  17.       printf("File Content :%s", s1);
  18.    }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment