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

stdin redirection only takes one input #22

Open
ZoomyCat opened this issue Dec 19, 2016 · 2 comments
Open

stdin redirection only takes one input #22

ZoomyCat opened this issue Dec 19, 2016 · 2 comments

Comments

@ZoomyCat
Copy link

ZoomyCat commented Dec 19, 2016

What I'm doing to trigger the activation:

Start the server in Terminal 1

touch ./in; cacaserver < ./in
initialised network, listening on port 51914
[4] connected from 127.0.0.1

Running nc in terminal 2

nc localhost 51914

Triggering the response in terminal 3

cat edge226.caca > ./in

Response in terminal 2 happens only once and only if the inital in file is empty.
Also attempted with a fifo file and this broke it completely and cacaserver did not even initialize listening on the network port.
I would have thought that cacaserver would have been able to refresh and take in more data after the first set.

@samhocevar
Copy link
Contributor

This happens because cacaserver stops at end of file (this is standard behaviour for Unix tools). You can use a fifo and the tail utility to avoid this:

mkfifo ./in ; tail -f ./in | cacaserver

And then:

cat edge226.caca > ./in

@ZoomyCat
Copy link
Author

@samhocevar Hey just wanted to let you know that your suggestion allowed me to do an ascii representation of my webcam however that was the best quality I was able to achieve because if I increased the resolution and the terminal size I would get 0 output. The highest terminal size I was able to achieve was a 132x40 in urxvt. Where as If I am processing different sized images this limitation seems to be different for some reason.

I'm probably going to sit down and make a video of the findings so its easier to explain what I am doing and what is going on.

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