On Tuesday 12 March 2002 12:30 pm, Jon Molin wrote:
[snip]
>
> I'm not sure i follow you here, will you have to process them at the
> same time so
> while (1)
> {
>   read tail
>   check result
>   read keyboard
>   check result
>   read radio
>   check result
>
> do other stuff
> }
> won't do?

This is basically what I need to do, but I don't want the code to block if 
there's no data available.

I've had a look at Term::ReadKey which is now doing what I want for the 
keyboard part, but when I use the same code on the broadcast file, it works 
once, and the stops working. By this, I mean that if the file already 
contains data, then it will process that data one line at a time, and then 
stop working.  If the file is empty when the program is started, the script 
will work correctly the first time a line is added, and will process the 
command as soon as it's sent.  However, subsequent lines are ignored.

It's as though an error flag has been set for the file which is preventing 
any further actions on the file to succeed.


I've had a look at the select statement which looks as though it may do what 
I want as far as checking to see if data is available on a file without 
blocking, but I'm having a bit of trouble understanding the docs.

Has anyone got any examples of using a select command do to the equivelent of

if (data available) {  # must not block here
  use data
}

>
[snip]
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to