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

Method Tell

Libraries/unrar/file.cpp:513–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511
512
513int64 File::Tell()
514{
515 if (hFile==FILE_BAD_HANDLE)
516 if (AllowExceptions)
517 ErrHandler.SeekError(FileName);
518 else
519 return -1;
520#ifdef _WIN_ALL
521 LONG HighDist=0;
522 uint LowDist=SetFilePointer(hFile,0,&HighDist,FILE_CURRENT);
523 if (LowDist==0xffffffff && GetLastError()!=NO_ERROR)
524 if (AllowExceptions)
525 ErrHandler.SeekError(FileName);
526 else
527 return -1;
528 return INT32TO64(HighDist,LowDist);
529#else
530#ifdef FILE_USE_OPEN
531 return lseek(hFile,0,SEEK_CUR);
532#elif defined(_LARGEFILE_SOURCE) && !defined(_OSF_SOURCE)
533 return ftello(hFile);
534#else
535 return ftell(hFile);
536#endif
537#endif
538}
539
540
541void File::Prealloc(int64 Size)

Callers 5

RestoreMethod · 0.45
TestMethod · 0.45
SaveFilePosMethod · 0.45
MergeArchiveFunction · 0.45
CalcFileSumFunction · 0.45

Calls 1

SeekErrorMethod · 0.80

Tested by 1

TestMethod · 0.36