MCPcopy Create free account
hub / github.com/Gregwar/fatcat / writeData

Method writeData

src/core/FatSystem.cpp:109–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109int FatSystem::writeData(unsigned long long address, const char *buffer, int size)
110{
111 if (!writeMode) {
112 throw string("Trying to write data while write mode is disabled");
113 }
114
115 lseek64(fd, globalOffset+address, SEEK_SET);
116
117 int n;
118 int pos = 0;
119 do {
120 n = write(fd, buffer, size);
121
122 if (n > 0) {
123 pos += n;
124 size -= n;
125 }
126 } while ((size>0) && (n>0));
127
128 return n;
129}
130
131/**
132 * Parses FAT header

Callers 2

mainFunction · 0.80
patchMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected