mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-13 17:05:37 -04: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:
parent
f079d57fc6
commit
e1cc0b1ad0
4 changed files with 27 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue