Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <iostream>
- int main(int argc, char **argv)
- {
- if (argc == 1)
- {
- cout << "I need dem doges and dem patriots poi" << endl;
- return -1;
- }
- char *doge = argv[2];
- char *patriot = argv[1];
- int wfd = open(patriot, O_WRONLY);
- int rfd = open(doge, O_RDONLY);
- char *buffer = new char[1024];
- int bytes_read;
- while(1)
- {
- while ((bytes_read = read(rfd, buffer, 1024)) != 0)
- {
- write(wfd, buffer, bytes_read);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement