Skip to content

Instantly share code, notes, and snippets.

@tarcisio-marinho
Created December 13, 2017 17:41
Show Gist options
  • Save tarcisio-marinho/8b6519ecd7d7c97b105e9a905efc8090 to your computer and use it in GitHub Desktop.
Save tarcisio-marinho/8b6519ecd7d7c97b105e9a905efc8090 to your computer and use it in GitHub Desktop.
find files
/* If finds a file, append to the linked list */
if(ent->d_type == 8){ // it's a file
while(ext != NULL){ // check file extension
if(strcmp(get_filename_ext(path_to_file), ext) == 0){
append(files, path_to_file, NULL, NULL);
break;
}
ext = strtok(NULL, " ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment