kkinnear/zprint

Is it possible to operate on a stream from stdin?

blak3mill3r opened this issue · 1 comments

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

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!