Skip to content
This repository was archived by the owner on Sep 4, 2023. It is now read-only.

Missing support for reading from stdin #8

Open
merces opened this issue Sep 6, 2016 · 5 comments
Open

Missing support for reading from stdin #8

merces opened this issue Sep 6, 2016 · 5 comments

Comments

@merces
Copy link
Owner

merces commented Sep 6, 2016

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

$ echo foo | hdump /dev/stdin
unable to seek through file
@UserXGnu
Copy link
Contributor

Trial of fixing it at #10

@merces
Copy link
Owner Author

merces commented Mar 30, 2017

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

@UserXGnu
Copy link
Contributor

UserXGnu commented Apr 5, 2017

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

@merces
Copy link
Owner Author

merces commented Apr 5, 2017

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

@UserXGnu
Copy link
Contributor

UserXGnu commented Apr 5, 2017

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 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants