fix for non existing dirs in ls-dir
This commit is contained in:
parent
56407f3516
commit
48ad953648
|
|
@ -36,7 +36,7 @@ MlValue list_dir(const std::string &path) {
|
||||||
|
|
||||||
DIR *dirp = opendir(path.c_str());
|
DIR *dirp = opendir(path.c_str());
|
||||||
if (dirp == NULL) {
|
if (dirp == NULL) {
|
||||||
// handle error - probably not a dir or non existing path
|
throw std::runtime_error("could not open dir (" + path + ")");
|
||||||
}
|
}
|
||||||
struct dirent *dp;
|
struct dirent *dp;
|
||||||
while ((dp = readdir(dirp)) != NULL) {
|
while ((dp = readdir(dirp)) != NULL) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue