Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fcntl.h>
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
- #define ROZMIAR_BUFORA 512
- void getMessage()
- {
- int wyniki = 0;
- char bufor[ROZMIAR_BUFORA];
- memset(&bufor[0], 0, sizeof(bufor));
- while((wyniki = open("dane.txt", O_RDWR)) < 0) {}
- if(wyniki != 0)
- {
- while(read(wyniki,bufor,ROZMIAR_BUFORA) < 1) {}
- printf("\nProducent:\n%s", bufor);
- // close(wyniki);
- printf("\n");
- }
- }
- int main(int argc, char *argv[])
- {
- printf("\n");
- getMessage();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement