We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8696ed4 commit dd28f2cCopy full SHA for dd28f2c
cpp/fzip/src/fzip.cpp
@@ -313,10 +313,17 @@ void parseArgs(int argc, const char **argv) {
313
usage(string("Cannot opendir ") + arg);
314
}
315
316
+
317
while ((dp = readdir(dirp)) != NULL) {
- if (dp->d_type == DT_REG) {
318
- paths.push_back(string(arg) + "/" + dp->d_name);
319
- }
+ struct stat st;
+ std::string path = string(arg) + "/" + dp->d_name;
320
+ if(0 == stat(path.c_str(), &st)){
321
+ if (S_ISREG(st.st_mode)) {
322
+ paths.push_back(path);
323
+ }
324
+ }else{
325
+ usage(string("Cannot stat ") + arg);
326
327
328
329
closedir(dirp);
0 commit comments