MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / getFile

Method getFile

lib/vfs/fatfs.cc:136–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134 }
135
136 Bytes getFile(const Path& path) override
137 {
138 mount();
139 auto pathstr = toUpper(path.to_str());
140 FIL fil;
141 FRESULT res = f_open(&fil, pathstr.c_str(), FA_READ);
142 throwError(res);
143
144 Bytes bytes;
145 ByteWriter bw(bytes);
146
147 while (!f_eof(&fil))
148 {
149 uint8_t buffer[4096];
150 UINT done;
151 res = f_read(&fil, buffer, sizeof(buffer), &done);
152 throwError(res);
153
154 bw += Bytes(buffer, done);
155 }
156
157 f_close(&fil);
158
159 return bytes;
160 }
161
162 void putFile(const Path& path, const Bytes& bytes) override
163 {

Callers

nothing calls this directly

Calls 3

toUpperFunction · 0.85
to_strMethod · 0.80
BytesClass · 0.50

Tested by

no test coverage detected