* Recurse the entire directory to find the newest file. * Make the found file the current selection. */
| 1073 | * Make the found file the current selection. |
| 1074 | */ |
| 1075 | bool CardReader::selectNewestFile() { |
| 1076 | uint32_t dateTimeStorage = 0; |
| 1077 | MediaFile foundDir; |
| 1078 | char foundName[FILENAME_LENGTH]; |
| 1079 | foundName[0] = '\0'; |
| 1080 | |
| 1081 | diveToNewestFile(root, dateTimeStorage, foundDir, foundName); |
| 1082 | |
| 1083 | if (foundName[0]) { |
| 1084 | workDir = foundDir; |
| 1085 | workDir.rewind(); |
| 1086 | selectByName(workDir, foundName); |
| 1087 | //workDir.close(); // Not needed? |
| 1088 | return true; |
| 1089 | } |
| 1090 | return false; |
| 1091 | } |
| 1092 | |
| 1093 | #endif // ONE_CLICK_PRINT |
| 1094 |