Updated directory iterator options

This commit is contained in:
Uwe Seimet 2021-09-18 19:28:55 +02:00
parent 26c6a902f1
commit 3b83b014b4

View File

@ -529,8 +529,8 @@ void GetAllDeviceTypeProperties(PbServerInfo& server_info)
void GetAvailableImages(PbServerInfo& server_info) void GetAvailableImages(PbServerInfo& server_info)
{ {
if (!access(default_image_folder.c_str(), F_OK)) { if (!access(default_image_folder.c_str(), F_OK)) {
for (const auto& entry : filesystem::directory_iterator(default_image_folder)) { for (const auto& entry : filesystem::directory_iterator(default_image_folder, filesystem::directory_options::skip_permission_denied)) {
if (entry.is_regular_file()) { if (entry.is_regular_file() && entry.file_size() && !(entry.file_size() & 0x1ff)) {
GetImageFile(server_info.add_image_files(), entry.path().filename()); GetImageFile(server_info.add_image_files(), entry.path().filename());
} }
} }