Thing is, I would also like to be able to open it in NONBLOCKING and be able to go off and update status displays while waiting for input.
I'd love for it to be as simple as
But it doesn't look like things are that easy cuz the buffering lib doesn't know how to handle a non-blocking case.while (<$fh> && ! eof($fh)){ unless ($_) { update_status; next; } #process input... }
So, I have to roll my own <> in a proc with read calls and such (been there, got programs that do that...I can copy my working code)...But ... I seem to remember on those progs, I handled the forking.
I was wondering if the open function's rules about doing a fork if it sees the "pipe char", still hold if I use the 3-arg form of open and specify O_NONBLOCK at open time, (then have to get the fileno from the FD, and use select or similar to do my waiting...)...
The key point being -- will open handle the fork and assignment of an IO-waiting process, or will the O_NONBLOCK interfere with that? I'm sorta guessing the latter, but was hoping someone might know for sure.....?
Thanks...
In reply to open (.."proc|",O_NONBLOCK)? by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |