MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / seek

Method seek

plugins/Bigfile/BigfilePlugin.py:544–549  ·  view source on GitHub ↗
(self, pos, whence=0)

Source from the content-addressed store, hash-verified

542 return self.f.read(buff)
543
544 def seek(self, pos, whence=0):
545 with self.read_lock:
546 if whence == 2: # Relative from file end
547 pos = self.size + pos # Use the real size instead of size on the disk
548 whence = 0
549 return self.f.seek(pos, whence)
550
551 def tell(self):
552 return self.f.tell()

Callers 10

writeMethod · 0.45
isReadableMethod · 0.45
testVerifyPieceMethod · 0.45
testSparseFileMethod · 0.45
testRangedFileRequestMethod · 0.45
testOpenBigfileMethod · 0.45
testFileGetMethod · 0.45
testPrebufferMethod · 0.45
testFileRenameMethod · 0.45

Calls

no outgoing calls

Tested by 8

testVerifyPieceMethod · 0.36
testSparseFileMethod · 0.36
testRangedFileRequestMethod · 0.36
testOpenBigfileMethod · 0.36
testFileGetMethod · 0.36
testPrebufferMethod · 0.36
testFileRenameMethod · 0.36