MCPcopy Create free account
hub / github.com/Boyle-Lab/Blacklist / getdir

Function getdir

blacklist.cpp:166–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166int getdir(std::string dirname, std::vector<string> & files, std::string filetype)
167{
168 DIR *dir;
169 int pos;
170 struct dirent *ent;
171 dir = opendir(dirname.c_str());
172 if (dir != NULL) {
173 while ((ent = readdir (dir)) != NULL) {
174 pos = strlen(ent->d_name) - 4;
175 if (! strcmp(&ent->d_name[pos], filetype.c_str())) {
176 //printf("%s\n", ent->d_name); //DEBUG
177 files.push_back(string(ent->d_name));
178 }
179 }
180 closedir (dir);
181 } else {
182 /* could not open directory */
183 cerr << "Unable to read input files!" << endl;
184 exit(1);
185 }
186}
187
188double quantile(std::vector<double> v, double q) {
189 sort(v.begin(), v.end());

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected