MCPcopy Create free account
hub / github.com/BruceDevices/firmware / appendToFile

Method appendToFile

src/core/connect/file_sharing.cpp:137–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137bool FileSharing::appendToFile(FileSharing::Message fileMessage) {
138 FS *fs;
139 if (!getFsStorage(fs)) return false;
140
141 if (recvFileName == "") createFilename(fs, fileMessage);
142
143 File file = (*fs).open(recvFileName, FILE_APPEND);
144 if (!file) return false;
145
146 file.write((const uint8_t *)fileMessage.data, fileMessage.dataSize);
147 file.close();
148
149 return true;
150}
151
152void FileSharing::createFilename(FS *fs, FileSharing::Message fileMessage) {
153 String messageFilename = String(fileMessage.filename);

Callers

nothing calls this directly

Calls 3

getFsStorageFunction · 0.85
closeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected