- for (auto i: boost::filesystem::directory_iterator(p)) {
- if (boost::filesystem::is_regular_file(i.path())) {
- LOG_GENERAL ("Inside there's regular file %1", i.path().string());
- add_path (i.path());
- } else if (boost::filesystem::is_directory(i.path()) && i.path().filename() != ".AppleDouble") {
- LOG_GENERAL ("Inside there's directory %1", i.path().string());
- read_sub_directory (i.path());
+ try {
+ for (auto i: directory_iterator(p)) {
+ if (is_regular_file(i.path())) {
+ LOG_GENERAL ("Inside there's regular file %1", i.path().string());
+ add_path (i.path());
+ } else if (is_directory(i.path()) && i.path().filename() != ".AppleDouble") {
+ LOG_GENERAL ("Inside there's directory %1", i.path().string());
+ read_sub_directory (i.path());
+ } else {
+ LOG_GENERAL("Ignoring %1 from inside: status is %2", i.path().string(), static_cast<int>(status(i.path()).type()));
+ }