Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int main(int argc, char const *argv[])
  2. {
  3.  
  4.  
  5. int fdDest;
  6. if((fdDest = open("test.jpg",O_WRONLY|O_CREAT|O_TRUNC,S_IRWXU)) == -1){
  7. perror("fichier de destination impossible à créer");
  8. exit(-1);
  9. }
  10.  
  11. int fdSrc;
  12. if((fdSrc = open("ab014.jpg",O_RDONLY)) == -1){
  13. perror("fichier de destination impossible à créer");
  14. exit(-1);
  15. }
  16.  
  17. file_to_file(fdSrc,fdDest);
  18.  
  19. close(fdDest);
  20. close(fdSrc);
  21.  
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement