From a80c723a32e89f21b9462e0840b0bc08f8a64245 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Fri, 15 Sep 2023 13:10:15 +0200 Subject: [PATCH] fix hd seek --- TODO.norg | 1 + src/hexdumper.py | 1 + 2 files changed, 2 insertions(+) diff --git a/TODO.norg b/TODO.norg index bdf1679..43a5cf7 100644 --- a/TODO.norg +++ b/TODO.norg @@ -13,6 +13,7 @@ This is a list of tasks that would be cool to add. - (x) Install script to system Using update-alternatives is the most handy - (x) Accept input from stdin when no file is given + - ( ) Process only first N or last N Bytes - ( ) Write a complete task for this stuff *** Networking - ( ) Mini curl diff --git a/src/hexdumper.py b/src/hexdumper.py index de02371..b7ae40e 100755 --- a/src/hexdumper.py +++ b/src/hexdumper.py @@ -80,6 +80,7 @@ def main(): try: file.seek(0, os.SEEK_END) flen = file.tell() + file.seek(0, os.SEEK_SET) except io.UnsupportedOperation: # some kinds of "files" like stdin are not seekable flen = 0