From 3b83b014b4c25b7b8cc65af6ee0bcc385f467565 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Sat, 18 Sep 2021 19:28:55 +0200 Subject: [PATCH] Updated directory iterator options --- src/raspberrypi/rascsi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index 2a0cd433..500f31cc 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -529,8 +529,8 @@ void GetAllDeviceTypeProperties(PbServerInfo& server_info) void GetAvailableImages(PbServerInfo& server_info) { if (!access(default_image_folder.c_str(), F_OK)) { - for (const auto& entry : filesystem::directory_iterator(default_image_folder)) { - if (entry.is_regular_file()) { + for (const auto& entry : filesystem::directory_iterator(default_image_folder, filesystem::directory_options::skip_permission_denied)) { + if (entry.is_regular_file() && entry.file_size() && !(entry.file_size() & 0x1ff)) { GetImageFile(server_info.add_image_files(), entry.path().filename()); } }