Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <fcntl.h>
  2. #include <unistd.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5.  
  6. #define ROZMIAR_BUFORA 512
  7.  
  8. void getMessage()
  9. {
  10. int wyniki = 0;
  11. char bufor[ROZMIAR_BUFORA];
  12. memset(&bufor[0], 0, sizeof(bufor));
  13.  
  14. while((wyniki = open("dane.txt", O_RDWR)) < 0) {}
  15.  
  16. if(wyniki != 0)
  17. {
  18. while(read(wyniki,bufor,ROZMIAR_BUFORA) < 1) {}
  19. printf("\nProducent:\n%s", bufor);
  20. // close(wyniki);
  21. printf("\n");
  22. }
  23. }
  24.  
  25.  
  26. int main(int argc, char *argv[])
  27. {
  28. printf("\n");
  29.  
  30. getMessage();
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement