annotate Doc/lib/libselect.tex @ 8831:00a6bb65ff29 legacy-trunk

Getting rid of this ancient stuff.
author Guido van Rossum <guido@python.org>
date Wed, 05 Aug 1998 21:10:09 +0000
parents 760dcf197048
children acfffe14628e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7877
8e5223680a9d Remove all uses of \sectcode; we can now use logical markup everywhere.
Fred Drake <fdrake@acm.org>
parents: 7789
diff changeset
1 \section{Built-in Module \module{select}}
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
2 \declaremodule{builtin}{select}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
3
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
4 \modulesynopsis{Wait for I/O completion on multiple streams.}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
5
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
7789
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
7 This module provides access to the function \cfunction{select()}
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
8 available in most \UNIX{} versions. It defines the following:
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 \begin{excdesc}{error}
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 The exception raised when an error occurs. The accompanying value is
7789
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
12 a pair containing the numeric error code from \cdata{errno} and the
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
13 corresponding string, as would be printed by the \C{} function
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
14 \cfunction{perror()}.
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 \end{excdesc}
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
16
7712
0cbc9df882b6 Change "\," to just "," in function signatures. This is easier to maintain,
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
17 \begin{funcdesc}{select}{iwtd, owtd, ewtd\optional{, timeout}}
7789
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
18 This is a straightforward interface to the \UNIX{} \cfunction{select()}
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 system call. The first three arguments are lists of `waitable
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 objects': either integers representing \UNIX{} file descriptors or
7789
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
21 objects with a parameterless method named \method{fileno()} returning
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 such an integer. The three lists of waitable objects are for input,
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 output and `exceptional conditions', respectively. Empty lists are
2630
6c89df576d91 minor things
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
24 allowed. The optional \var{timeout} argument specifies a time-out as a
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 floating point number in seconds. When the \var{timeout} argument
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 is omitted the function blocks until at least one file descriptor is
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 ready. A time-out value of zero specifies a poll and never blocks.
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
28
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 The return value is a triple of lists of objects that are ready:
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 subsets of the first three arguments. When the time-out is reached
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 without a file descriptor becoming ready, three empty lists are
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 returned.
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
33
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 Amongst the acceptable object types in the lists are Python file
7789
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
35 objects (e.g. \code{sys.stdin}, or objects returned by
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
36 \function{open()} or \function{os.popen()}), socket objects
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
37 returned by \function{socket.socket()},%
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
38 \withsubitem{(in module socket)}{\ttindex{socket()}}
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
39 \withsubitem{(in module posix)}{\ttindex{popen()}}
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
40 \withsubitem{(in module os)}{\ttindex{popen()}}
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
41 and the module \module{stdwin}\refbimodindex{stdwin} which happens to
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
42 define a function \function{fileno()}%
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
43 \withsubitem{(in module stdwin)}{\ttindex{fileno()}}
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
44 for just this purpose. You may
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 also define a \dfn{wrapper} class yourself, as long as it has an
7789
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
46 appropriate \method{fileno()} method (that really returns a \UNIX{}
88c53921bf88 Markup nits, index entries.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
47 file descriptor, not just a random integer).
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 \end{funcdesc}