Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. char *new_file_path = malloc(strlen(file_from_list_path[buff_ind]) + 20);
  2. sprintf(new_file_path, "%s%s", file_from_list_path[buff_ind], get_time(last_modification));
  3. int proc = fork();
  4. if(proc == 0){
  5. execl("/bin/cp", "cp", file_from_list_path[buff_ind], new_file_path, (char *) 0);
  6. exit(-1);
  7. }else{
  8. waitpid(proc,NULL,0);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement