MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / RawSeek

Method RawSeek

Libraries/unrar/file.cpp:482–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480
481
482bool File::RawSeek(int64 Offset,int Method)
483{
484 if (hFile==FILE_BAD_HANDLE)
485 return true;
486 if (Offset<0 && Method!=SEEK_SET)
487 {
488 Offset=(Method==SEEK_CUR ? Tell():FileLength())+Offset;
489 Method=SEEK_SET;
490 }
491#ifdef _WIN_ALL
492 LONG HighDist=(LONG)(Offset>>32);
493 if (SetFilePointer(hFile,(LONG)Offset,&HighDist,Method)==0xffffffff &&
494 GetLastError()!=NO_ERROR)
495 return false;
496#else
497 LastWrite=false;
498#ifdef FILE_USE_OPEN
499 if (lseek(hFile,(off_t)Offset,Method)==-1)
500 return false;
501#elif defined(_LARGEFILE_SOURCE) && !defined(_OSF_SOURCE) && !defined(__VMS)
502 if (fseeko(hFile,Offset,Method)!=0)
503 return false;
504#else
505 if (fseek(hFile,(long)Offset,Method)!=0)
506 return false;
507#endif
508#endif
509 return true;
510}
511
512
513int64 File::Tell()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected