reworking block skipper

This commit is contained in:
Edwin Eefting
2022-03-07 21:08:56 +01:00
parent b68ca19e5f
commit 233745c345
4 changed files with 54 additions and 7 deletions

View File

@ -61,14 +61,9 @@ class BlockHasher():
yields nothing for empty files.
"""
with os.open(fname, os.O_RDONLY) as fh:
print (os.lseek(fh, 0, os.SEEK_END))
with os.openopen(fname, "rb") as fh:
# print(os.path.getsize(fname))
print(os.lseek(fh, 0, os.SEEK_END))
with open(fname, "rb") as fh:
fsize = fh.seek(0, os.SEEK_END)
fh.seek(0)

View File

@ -39,7 +39,7 @@ class ZfsCheck(CliBase):
group.add_argument('--check', '-c', metavar="FILE", default=None, const=True, nargs='?',
help="Read hashes from STDIN (or FILE) and compare them")
group.add_argument('--skip', '-s', metavar="NUMBER", default=0, type=float,
group.add_argument('--skip', '-s', metavar="NUMBER", default=0, type=int,
help="Skip this number of chunks after every hash. %(default)s")
return parser