MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / copyFile

Function copyFile

src/sd_functions.cpp:137–153  ·  view source on GitHub ↗

** Function name: copyFile ** Description: copy file address to memory ***************************************************************************************/

Source from the content-addressed store, hash-verified

135** Description: copy file address to memory
136***************************************************************************************/
137bool copyFile(String path) {
138 if (!setupSdCard()) {
139 // Serial.println("Fail to start SDCard");
140 return false;
141 }
142 File file = SDM.open(path, FILE_READ);
143 if (!file.isDirectory()) {
144 fileToCopy = path;
145 file.close();
146 return true;
147 } else {
148 displayRedStripe("Cannot copy Folder");
149 launcherDelayMs(2000);
150 file.close();
151 return false;
152 }
153}
154
155/***************************************************************************************
156** Function name: pasteFile

Callers 1

loopSDFunction · 0.85

Calls 3

displayRedStripeFunction · 0.85
launcherDelayMsFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected