Skip to content

Commit

Permalink
Custom tar parser: end of record
Browse files Browse the repository at this point in the history
  • Loading branch information
leogao2 committed Sep 18, 2020
1 parent 5b17330 commit 83612b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lm_dataformat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def read_tgz(self, file):

# https://www.gnu.org/software/tar/manual/html_node/Standard.html
# end at 135 not 136 because of \0 terminator
if hdr[124:135] == b'\0'*11:
# end of record
break
size = int(hdr[124:135], 8)

padded_size = ceil(size / 512) * 512
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="lm_dataformat", # Replace with your own username
version="0.0.12",
version="0.0.13",
author="Leo Gao",
author_email="leogao31@gmail.com",
description="A utility for storing and reading files for LM training.",
Expand Down

0 comments on commit 83612b9

Please sign in to comment.