fix for non existing dirs in ls-dir
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user