Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <errno.h>
- #include <unistd.h>
- #include <string.h>
- int main(int argc, char*argv[])
- {
- int fd;
- int a;
- int rozmiar=180;
- char buf[180];
- int f1;
- int pomoc;
- if(argc!=3)
- {
- printf("zla liczba argumentow");
- }
- else
- {
- fd=creat(argv[1], 0644);
- //tu powinno byc cos z tym errno ale nwm co //
- f1=open(argv[2], 0644);
- while(a= read(f1,buf,rozmiar)) //czytamy z pliku
- {
- write(fd,buf,rozmiar); //zapisujemy do pliku
- rozmiar=rozmiar-a;
- }
- printf("koniec zapisywania");
- }
- getchar ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement