Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include <sys/types.h>
- //#include <sys/stat.h>
- #include <fcntl.h>
- #include <stdlib.h>
- //#include <unistd.h>
- int main(int argc, char* argv[])
- {
- int fileFrom=open(argv[1],O_RDONLY);
- int fileTo=open("test5.txt",O_RDWR|O_CREAT| O_TRUNC| O_APPEND);
- char *buff=malloc(1);
- if(fileTo==-1 || fileFrom==-1)
- perror("zjebalo sie");
- while(read(fileFrom,buff,1))
- {
- if(*buff>='A' &&*buff<='Z')
- *buff=*buff+32;
- if(write(fileTo,buff,1))
- printf("writing...\n");
- }
- free(buff);
- close(fileTo);
- close(fileFrom);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement