Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <unistd.h>
  2. #include <sys/stat.h>
  3. #include <fcntl.h>
  4. #include <stdlib.h>
  5.  
  6. int main()
  7. {
  8. char c;
  9. int in, out;
  10. in = open("in.dat", O_RDONLY);
  11. out = creat("out.dat", 0644);
  12. while (read(in, &c, 1) == 1) {
  13. write(out, &c, 1);
  14. }
  15. close(in);
  16. close(out);
  17. exit(0);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement