-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHi.c.save
More file actions
51 lines (47 loc) · 955 Bytes
/
Hi.c.save
File metadata and controls
51 lines (47 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<stdio.h>
#include<dirent.h>
#include<string.h>
char getcaseless(char in){
char out;
if(out > 64&&out < 91) out = out + 32;
return out;
}
void DataFinder(char* sKey,char* fPath){
FILE *domain;
printf("Got here");
domain = fopen(fPath,'r');
printf("Opened file.");
int length = sizeof(sKey);
printf("Found key length");
int backPointer;
char* stack = "";
for(int i = 0;i < length;i++){
stack += getcaseless(fgetc(domain));
}
printf("%s\n",stack);
fclose(domain);
}
void list(char* sKey){
DIR *dir;
char* name;
struct dirent *ent;
if ((dir = opendir ("./data/")) != NULL) {
while ((ent = readdir (dir)) != NULL) {
name = ent->d_name;
if(strcmp(name,".")&&strcmp(name,"..")){
name = "./data/";
name ;
printf("%s\n", name);
}
}
closedir (dir);
} else {
return;
}
}
int main(int argc,char** argv){
char* sKey = argv[1];
printf("%s\n",sKey);
list(sKey);//,"./data/testrange.txt");
return 0;
}