| 160 | } |
| 161 | |
| 162 | void putFile(const Path& path, const Bytes& bytes) override |
| 163 | { |
| 164 | mount(); |
| 165 | auto pathstr = toUpper(path.to_str()); |
| 166 | FIL fil; |
| 167 | FRESULT res = |
| 168 | f_open(&fil, pathstr.c_str(), FA_WRITE | FA_CREATE_ALWAYS); |
| 169 | throwError(res); |
| 170 | |
| 171 | unsigned remaining = bytes.size(); |
| 172 | char* ptr = (char*)bytes.cbegin(); |
| 173 | while (remaining != 0) |
| 174 | { |
| 175 | UINT done; |
| 176 | res = f_write(&fil, ptr, remaining, &done); |
| 177 | throwError(res); |
| 178 | |
| 179 | remaining -= done; |
| 180 | ptr += done; |
| 181 | } |
| 182 | |
| 183 | f_close(&fil); |
| 184 | } |
| 185 | |
| 186 | void deleteFile(const Path& path) override |
| 187 | { |