Missing support for reading from stdin
merces opened this issue · 5 comments
$ echo foo | hdump
Usage:
hdump [-c columns] [-s skip] [-n length] file
$ echo foo | hdump /dev/stdin
unable to seek through file
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
My bad, I forgot to test it without specifying /dev/stdin, sorry! Follows the pr fixing it #11
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
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:
commit ec9c4ec
Author: userx user_x@riseup.net
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 (root@andromeda.sabayon.org) (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