Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to operate on a stream from stdin? #332

Open
blak3mill3r opened this issue Aug 25, 2024 · 1 comment
Open

Is it possible to operate on a stream from stdin? #332

blak3mill3r opened this issue Aug 25, 2024 · 1 comment

Comments

@blak3mill3r
Copy link

I couldn't find a way to do this with zprint, I suspect it isn't supported.

I wonder what it would take to add that. I think it would be useful.

I tried this, hoping it would work:

tail -f something.edn | zprint
@kkinnear
Copy link
Owner

kkinnear commented Sep 2, 2024

Sorry for the delay in replying. Been a busy week around here!

What an interesting request. I have used tail -f for years in a different context than zprint, but certainly never imagined piping the output of tail -f to another program! I presume that you want what shows up on stdout to be the formatted file, and if more stuff ends up in the file, that additional stuff would also show up (formatted of course) on stdout?

Presently, zprint reads the entire file into memory before formatting it, so it won't do anything until the input file is closed.

I'm interested in your particular use case. It would probably be quite a bit of work to alter zprint to format an input file in fragments instead of processing the whole file. Before I would tackle that as a new feature, I'd like to better understand what you are trying to accomplish. I can imagine some use cases, but I've found that people's actual use cases rarely match up to my imagination. Thanks!

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

No branches or pull requests

2 participants