MCPcopy Create free account
hub / github.com/alibaba/MNN / MNNSetFilePointer

Function MNNSetFilePointer

source/core/MNNFileUtils.cpp:248–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248ErrorCode MNNSetFilePointer(file_t file, size_t offset)
249{
250 if (file == INVALID_FILE) {
251 return FILE_NOT_EXIST;
252 }
253#if defined(WIN32) || defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
254 LARGE_INTEGER liDistanceToMove;
255 liDistanceToMove.QuadPart = offset;
256 if (SetFilePointerEx(file, liDistanceToMove, NULL, FILE_BEGIN)) {
257 return NO_ERROR;
258 } else {
259 return FILE_SEEK_FAILED;
260 }
261#else
262 if (-1 == lseek(file, offset, SEEK_SET)) {
263 return FILE_SEEK_FAILED;
264 } else {
265 return NO_ERROR;
266 }
267#endif
268}
269
270void * MNNMmapFile(file_t file, size_t size, bool onlyRead)
271{

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by 1

runMethod · 0.68