Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<unistd.h>
  3. #include<string.h>
  4. #include<fcntl.h>
  5. #include<sys/stat.h>
  6. #include<sys/types.h>
  7. #include<ctype.h>
  8.  
  9. int main()
  10. {
  11.  
  12.  char *myfifo="/home/konrad/Pulpit/program2.1/pipe";
  13.  int fd;
  14.  char tab[30];
  15.  fd=open(myfifo,O_RDONLY);
  16.  //fgets(tab,30,stdin);
  17.  read(fd,tab,31);
  18.  for(int i=0;i<30;i++)
  19.  {
  20.   if(islower(tab[i])) tab[i]=toupper(tab[i]);
  21.  }
  22.  close(fd);
  23.  fd=open(myfifo,O_WRONLY);
  24.  write(fd,tab,31);
  25.  close(fd);
  26.  return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement