MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / selectFileByName

Method selectFileByName

Marlin/src/sd/cardreader.cpp:1132–1145  ·  view source on GitHub ↗

Get info for a file in the working directory by DOS name

Source from the content-addressed store, hash-verified

1130// Get info for a file in the working directory by DOS name
1131//
1132void CardReader::selectFileByName(const char * const match) {
1133 #if ENABLED(SDSORT_CACHE_NAMES)
1134 for (int16_t nr = 0; nr < sort_count; nr++)
1135 if (strcasecmp(match, sortshort[nr]) == 0) {
1136 strcpy(filename, sortshort[nr]);
1137 strcpy(longFilename, sortnames[nr]);
1138 TERN_(HAS_FOLDER_SORTING, flag.filenameIsDir = IS_DIR(nr));
1139 setBinFlag(extIsBIN(strrchr(filename, '.') + 1));
1140 return;
1141 }
1142 #endif
1143 workDir.rewind();
1144 selectByName(workDir, match);
1145}
1146
1147/**
1148 * Dive to the given DOS 8.3 file path, with optional echo of the dive paths.

Callers 2

popupPowerLossRecoveryFunction · 0.80
startPrintMethod · 0.80

Calls 2

extIsBINFunction · 0.85
rewindMethod · 0.45

Tested by

no test coverage detected