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

Method putFile

lib/vfs/amigaffs.cc:173–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 void putFile(const Path& path, const Bytes& data) override
174 {
175 AdfMount m(this);
176 if (path.size() == 0)
177 throw BadPathException();
178
179 auto* vol = m.mount();
180 changeDirButOne(vol, path);
181
182 auto* file = adfOpenFile(vol, (char*)path.back().c_str(), (char*)"w");
183 if (!file)
184 throw CannotWriteException();
185
186 unsigned pos = 0;
187 while (pos != data.size())
188 {
189 long done = adfWriteFile(
190 file, data.size() - pos, (uint8_t*)data.cbegin() + pos);
191 pos += done;
192 }
193
194 adfCloseFile(file);
195 }
196
197 void deleteFile(const Path& path) override
198 {

Callers

nothing calls this directly

Calls 8

BadPathExceptionClass · 0.85
adfOpenFileFunction · 0.85
adfWriteFileFunction · 0.85
adfCloseFileFunction · 0.85
cbeginMethod · 0.80
sizeMethod · 0.45
mountMethod · 0.45

Tested by

no test coverage detected