Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <sys/types.h>
- #include <dirent.h>
- #include <string.h>
- #include <ctype.h>
- int main()
- {
- char *keywords="flag hello keyword";
- DIR *dir;
- struct dirent *entry;
- char *dirinput="./search/";
- dir = opendir(dirinput);
- if (dir == NULL)
- {
- perror("error dir open =(");
- return 1;
- }
- while ( (entry = readdir(dir)) != NULL)
- {
- char *name = entry->d_name;
- printf("%s\n", name);
- if (strcmp(name,"..")==0 || strcmp(name,".")==0)
- {
- continue;
- }
- ///функции
- char way[50] = "./search/";
- strcat(way, name);
- printf("%s\n", way);
- FILE *file;
- file = fopen(way,"r");
- if (file == NULL)
- {
- perror("error file open )=");
- return 1;
- }
- char *word;
- for (int i=0; i<strlen(keywords); i++)
- {
- if (!isspace(keywords))
- {
- }
- }
- while (getc(file) != EOF)//
- {
- }
- fclose(file);
- }
- closedir(dir);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement