committed ziberpunk's patch...
...to make detecting if something is a directory use stat on non-Windows systems
This commit is contained in:
parent
a03bea0350
commit
04fef03108
1 changed files with 3 additions and 7 deletions
|
@ -239,13 +239,9 @@ bool is_directory_internal(const std::string& fname)
|
|||
}
|
||||
|
||||
#else
|
||||
DIR* const dir = opendir(fname.c_str());
|
||||
if(dir != NULL) {
|
||||
closedir(dir);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
struct stat dir_stat;
|
||||
::stat(fname.c_str(), &dir_stat);
|
||||
return S_ISDIR(dir_stat.st_mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue