Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. else if(S_ISDIR(h.kind))
  2. {
  3. printf("nits a directory #######n");
  4. struct dirent* entry = NULL;
  5. DIR* dir = opendir(h.name);
  6. if (dir == NULL) {
  7. printf("Directory couldn't be openedn");
  8. exit(1);
  9. }
  10.  
  11. while ((entry = readdir(dir))) {
  12. printf("n %s ********** n %s ******* nn" , entry->d_name,fileB );
  13. if (strcmp(".", entry->d_name) != 0 && strcmp("..", entry->d_name) != 0) {
  14. printf("before recursion entry= %s , fileB= %s n",entry->d_name,fileB);
  15. backup(fileB,entry->d_name, archive_file);
  16. printf("after recursion entry= %s , fileB= %s n",entry->d_name,fileB);
  17. }
  18. }
  19.  
  20. if (closedir(dir)) {
  21. printf("close dir error");
  22. exit(1);
  23. }
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement