Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SO IS1 211A LAB06
- // Maciej Doktor
- // dm44307@zut.edu.pl
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <io.h>
- #include <stdio.h>
- int main(int argc, char * argv[]) {
- int znaki, plik,r;
- char bufor;
- for(;;) {
- plik = open("baza.txt", O_WRONLY | O_CREAT | O_EXCL, 0777);
- if (plik < 0) {
- continue;
- }
- else {
- r = read(0,&bufor,sizeof(char));
- znaki = write(plik, &bufor, sizeof(char));
- close(plik);
- if(r == '*'){
- break;
- close(plik);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement