MCPcopy Index your code
hub / github.com/danfengcao/binlog2sql / reversed_blocks

Function reversed_blocks

binlog2sql/binlog2sql_util.py:259–267  ·  view source on GitHub ↗

Generate blocks of file's contents in reverse order.

(fin, block_size=4096)

Source from the content-addressed store, hash-verified

257
258
259def reversed_blocks(fin, block_size=4096):
260 """Generate blocks of file's contents in reverse order."""
261 fin.seek(0, os.SEEK_END)
262 here = fin.tell()
263 while 0 < here:
264 delta = min(block_size, here)
265 here -= delta
266 fin.seek(here, os.SEEK_SET)
267 yield fin.read(delta)

Callers 1

reversed_linesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected