bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading /dev/stdin Input with a Timeout


From: Andrew J. Schorr
Subject: Re: Reading /dev/stdin Input with a Timeout
Date: Thu, 14 Dec 2023 17:54:58 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

I think the attached patch fixes this, but I fear that I may be missing
something subtle about how GAWK_READ_TIMEOUT is supposed to work, because I
can't fathom why it was coded the other way previously...

Regards,
Andy

On Thu, Dec 14, 2023 at 07:02:58AM -0600, Ed Morton wrote:
> Though this doesn't work:
> 
>    GAWK_READ_TIMEOUT=1000 gawk '
>         { print "You entered: " $0 }
>    '
> 
> this does:
> 
>    GAWK_READ_TIMEOUT=1000 gawk '
>         BEGIN {
>             if ( !("-","READ_TIMEOUT") in PROCINFO ) {
>                 PROCINFO["-","READ_TIMEOUT"] = ENVIRON["GAWK_READ_TIMEOUT"]
>             }
>         }
>         { print "You entered: " $0 }
>    '
>    gawk: cmd. line:4: fatal: error reading input file `-': Connection
>    timed out
> 
> so there's a workaround, though it seems like a fix should be
> possible for this GAWK_READ_TIMEOUT problem (which is apparently
> different from John's original PROCINFO["-","READ_TIMEOUT"]  MinGW
> problem).
> 
>     Ed.

Attachment: read_timeout.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]