The gawk master branch has added support for two new features. As per the NEWS file:
11. Gawk now supports retryable I/O via PROCINFO[input-file, "RETRY"]; see
the manual.
12. The API minor version has been increased to two; the get_file()
API provides access to open redirections. Also see the manual.
With these changes, it is now possible to have I/O multiplexing in gawk using select. If this is of interest, please download gawk here:
git clone git://
git.savannah.gnu.org/gawk.git
You can then build the new gawkextlib select extension which provides a select function, non-blocking I/O, and some signal trapping capabilities. You can download it here:
https://sourceforge.net/projects/gawkextlib/files/
Please refer to the bundled man page, test cases, and examples to see how it works. The select extension has been tested on Linux and Cygwin. Testing on other platforms would be much appreciated. Comments, criticisms and feedback are welcome.
With these building blocks in place, it should now be possible to build a socket library and a GUI toolkit for gawk. One could also implement a poll interface in a similar fashion to select, if that's of interest.
Even if I/O multiplexing is not interesting to you, note that the new retryable I/O support enhances the value of the read timeout mechanism. For an example, you can look at the test/timeout.awk code in the gawk master branch.
Regards,
Andy