hdump icon indicating copy to clipboard operation
hdump copied to clipboard

Missing support for reading from stdin

Open merces opened this issue 7 years ago • 5 comments

$ echo foo | hdump
Usage:
        hdump [-c columns] [-s skip] [-n length] file

$ echo foo | hdump /dev/stdin
unable to seek through file

merces avatar Sep 06 '16 06:09 merces

Trial of fixing it at #10

UserXGnu avatar Mar 30 '17 03:03 UserXGnu

Have you tested that in Linux? I couldn't verify it working :-(

$ cat /bin/ls | ./hdump
Usage:
	hdump [-c columns] [-s skip] [-n length] file

merces avatar Mar 30 '17 14:03 merces

My bad, I forgot to test it without specifying /dev/stdin, sorry! Follows the pr fixing it #11

UserXGnu avatar Apr 05 '17 16:04 UserXGnu

No problem, @UserXGnu. I really appreciate your help. However, I wasn't able to read from stdin yet. Or maybe am I doing something wrong?

$ git clone https://github.com/UserXGnu/hdump.git
Cloning into 'hdump'...
remote: Counting objects: 93, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 93 (delta 0), reused 0 (delta 0), pack-reused 88
Unpacking objects: 100% (93/93), done.
Checking connectivity... done.

$ cd hdump

$ git log -1
commit ec9c4ec8de4cc1c38cd646b4b0c18b1481e69f51
Author: userx <user_x@...>
Date:   Wed Apr 5 16:24:48 2017 +0000

    adding support for reading from stdin.

$ make
gcc -Wall -Wextra -pedantic -o hdump hdump.c

$ echo test | ./hdump
Usage:
	hdump [-c columns] [-s skip] [-n length] file

$ cat /bin/ls | ./hdump
Usage:
	hdump [-c columns] [-s skip] [-n length] file

OS is Linux 64-bits but I also tested on macOS.

Thanks, Fernando

merces avatar Apr 05 '17 17:04 merces

Hello @merces, I tested here, and it's working fine, I don't know why It isn't working for you but just to be sure, here follows the project specs and my system's compiler version, if you have any ideas, bring it on =-D:

captura de ecra de 2017-04-05 19-00-25

commit ec9c4ec8de4cc1c38cd646b4b0c18b1481e69f51 Author: userx [email protected] Date: Wed Apr 5 16:24:48 2017 +0000

adding support for reading from stdin.

I also tested on a sabayon Linux 64bits and it worked just fine too. the kernel specs: Linux version 4.8.0-sabayon ([email protected]) (gcc version 4.9.3 (Gentoo Hardened 4.9.3 p1.1, pie-0.6.2) ) #1 SMP Mon Jan 23 17:20:20 UTC 2017

UserXGnu avatar Apr 05 '17 18:04 UserXGnu