Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if(S_ISDIR(h.kind))
- {
- printf("nits a directory #######n");
- struct dirent* entry = NULL;
- DIR* dir = opendir(h.name);
- if (dir == NULL) {
- printf("Directory couldn't be openedn");
- exit(1);
- }
- while ((entry = readdir(dir))) {
- printf("n %s ********** n %s ******* nn" , entry->d_name,fileB );
- if (strcmp(".", entry->d_name) != 0 && strcmp("..", entry->d_name) != 0) {
- printf("before recursion entry= %s , fileB= %s n",entry->d_name,fileB);
- backup(fileB,entry->d_name, archive_file);
- printf("after recursion entry= %s , fileB= %s n",entry->d_name,fileB);
- }
- }
- if (closedir(dir)) {
- printf("close dir error");
- exit(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement