Name

select

select readfileIds [writefileIds] [exceptfileIds] [timeout]

Wait for a change of status in file identifiers. Up to three lists, containing file identifiers for files to be polled for read, write, or exceptions, can be specified. An optional parameter timeout indicates the maximum time, in seconds, to wait (it can be 0 for polling). The command returns three lists, corresponding to the file descriptors in each of the three categories that have a change in status.

On Windows, only sockets can be used with the select command.

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.