mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 02:07:55 +00:00
Show file count in each directory, and moved "Too many files" message (#1376)
* Added file_count() function * Show file count in each directory; moved "Too many files!" warning
This commit is contained in:
@@ -579,6 +579,17 @@ bool is_empty_directory(const path& file_path) {
|
||||
return !((result == FR_OK) && (filinfo.fname[0] != (TCHAR)'\0'));
|
||||
}
|
||||
|
||||
int file_count(const path& directory) {
|
||||
int count{0};
|
||||
|
||||
for (auto& entry : std::filesystem::directory_iterator(directory, (const TCHAR*)u"*")) {
|
||||
(void)entry; // avoid unused warning
|
||||
++count;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
space_info space(const path& p) {
|
||||
DWORD free_clusters{0};
|
||||
FATFS* fs;
|
||||
|
Reference in New Issue
Block a user