Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libposix.tex @ 5817:48b94de85bf3 legacy-trunk
Extensive changes by AMK.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Jul 1997 16:29:42 +0000 |
| parents | 75762c67200c |
| children | 3468ea8645ca |
| rev | line source |
|---|---|
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 \section{Built-in Module \sectcode{posix}} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 \bimodindex{posix} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 This module provides access to operating system functionality that is |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2137
diff
changeset
|
5 standardized by the C Standard and the POSIX standard (a thinly disguised |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 \UNIX{} interface). |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
7 |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
8 \strong{Do not import this module directly.} Instead, import the |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
9 module \code{os}, which provides a \emph{portable} version of this |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
10 interface. On \UNIX{}, the \code{os} module provides a superset of |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
11 the \code{posix} interface. On non-\UNIX{} operating systems the |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
12 \code{posix} module is not available, but a subset is always available |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
13 through the \code{os} interface. Once \code{os} is imported, there is |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
14 \emph{no} performance penalty in using it instead of |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
15 \code{posix}. |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
16 \stmodindex{os} |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
17 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
18 The descriptions below are very terse; refer to the |
|
2647
9b7e6d9a528d
typos, layout and other small things
Guido van Rossum <guido@python.org>
parents:
2620
diff
changeset
|
19 corresponding \UNIX{} manual entry for more information. Arguments |
|
9b7e6d9a528d
typos, layout and other small things
Guido van Rossum <guido@python.org>
parents:
2620
diff
changeset
|
20 called \var{path} refer to a pathname given as a string. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 Errors are reported as exceptions; the usual exceptions are given |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
23 for type errors, while errors reported by the system calls raise |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
24 \code{posix.error}, described below. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
25 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
26 Module \code{posix} defines the following data items: |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
27 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
28 \renewcommand{\indexsubitem}{(data in module posix)} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
29 \begin{datadesc}{environ} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
30 A dictionary representing the string environment at the time |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
31 the interpreter was started. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
32 For example, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
33 \code{posix.environ['HOME']} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
34 is the pathname of your home directory, equivalent to |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
35 \code{getenv("HOME")} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
36 in C. |
|
2576
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
37 Modifying this dictionary does not affect the string environment |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
38 passed on by \code{execv()}, \code{popen()} or \code{system()}; if you |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
39 need to change the environment, pass \code{environ} to \code{execve()} |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
40 or add variable assignments and export statements to the command |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
41 string for \code{system()} or \code{popen()}.% |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
42 \footnote{The problem with automatically passing on \code{environ} is |
|
f47bc5554418
mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents:
2527
diff
changeset
|
43 that there is no portable way of changing the environment.} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
44 \end{datadesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
45 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
46 \renewcommand{\indexsubitem}{(exception in module posix)} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
47 \begin{excdesc}{error} |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2137
diff
changeset
|
48 This exception is raised when a POSIX function returns a |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
49 POSIX-related error (e.g., not for illegal argument types). Its |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
50 string value is \code{'posix.error'}. The accompanying value is a |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
51 pair containing the numeric error code from \code{errno} and the |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
52 corresponding string, as would be printed by the C function |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
53 \code{perror()}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
54 \end{excdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
55 |
| 2620 | 56 It defines the following functions and constants: |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
57 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
58 \renewcommand{\indexsubitem}{(in module posix)} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
59 \begin{funcdesc}{chdir}{path} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
60 Change the current working directory to \var{path}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
61 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
62 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
63 \begin{funcdesc}{chmod}{path\, mode} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
64 Change the mode of \var{path} to the numeric \var{mode}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
65 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
66 |
|
2064
280f31e6c653
copyright.tex: Add 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1550
diff
changeset
|
67 \begin{funcdesc}{chown}{path\, uid, gid} |
|
280f31e6c653
copyright.tex: Add 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1550
diff
changeset
|
68 Change the owner and group id of \var{path} to the numeric \var{uid} |
|
280f31e6c653
copyright.tex: Add 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1550
diff
changeset
|
69 and \var{gid}. |
|
280f31e6c653
copyright.tex: Add 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1550
diff
changeset
|
70 (Not on MS-DOS.) |
|
280f31e6c653
copyright.tex: Add 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1550
diff
changeset
|
71 \end{funcdesc} |
|
280f31e6c653
copyright.tex: Add 1995 to copyright message.
Guido van Rossum <guido@python.org>
parents:
1550
diff
changeset
|
72 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
73 \begin{funcdesc}{close}{fd} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
74 Close file descriptor \var{fd}. |
|
2137
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
75 |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
76 Note: this function is intended for low-level I/O and must be applied |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
77 to a file descriptor as returned by \code{posix.open()} or |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
78 \code{posix.pipe()}. To close a ``file object'' returned by the |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
79 built-in function \code{open} or by \code{posix.popen} or |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
80 \code{posix.fdopen}, use its \code{close()} method. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
81 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
82 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
83 \begin{funcdesc}{dup}{fd} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
84 Return a duplicate of file descriptor \var{fd}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
85 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
86 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
87 \begin{funcdesc}{dup2}{fd\, fd2} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
88 Duplicate file descriptor \var{fd} to \var{fd2}, closing the latter |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
89 first if necessary. Return \code{None}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
90 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
91 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
92 \begin{funcdesc}{execv}{path\, args} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
93 Execute the executable \var{path} with argument list \var{args}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
94 replacing the current process (i.e., the Python interpreter). |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
95 The argument list may be a tuple or list of strings. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
96 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
97 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
98 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
99 \begin{funcdesc}{execve}{path\, args\, env} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
100 Execute the executable \var{path} with argument list \var{args}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
101 and environment \var{env}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
102 replacing the current process (i.e., the Python interpreter). |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
103 The argument list may be a tuple or list of strings. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
104 The environment must be a dictionary mapping strings to strings. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
105 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
106 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
107 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
108 \begin{funcdesc}{_exit}{n} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
109 Exit to the system with status \var{n}, without calling cleanup |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
110 handlers, flushing stdio buffers, etc. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
111 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
112 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
113 Note: the standard way to exit is \code{sys.exit(\var{n})}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
114 \code{posix._exit()} should normally only be used in the child process |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
115 after a \code{fork()}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
116 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
117 |
|
2137
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
118 \begin{funcdesc}{fdopen}{fd\optional{\, mode\optional{\, bufsize}}} |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
119 Return an open file object connected to the file descriptor \var{fd}. |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
120 The \var{mode} and \var{bufsize} arguments have the same meaning as |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
121 the corresponding arguments to the built-in \code{open()} function. |
|
1550
980626ecad61
At release 1.0.1. Scripts, Makefile, README: cosmetic changes and
Guido van Rossum <guido@python.org>
parents:
1471
diff
changeset
|
122 \end{funcdesc} |
|
980626ecad61
At release 1.0.1. Scripts, Makefile, README: cosmetic changes and
Guido van Rossum <guido@python.org>
parents:
1471
diff
changeset
|
123 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
124 \begin{funcdesc}{fork}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
125 Fork a child process. Return 0 in the child, the child's process id |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
126 in the parent. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
127 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
128 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
129 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
130 \begin{funcdesc}{fstat}{fd} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
131 Return status for file descriptor \var{fd}, like \code{stat()}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
132 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
133 |
|
5680
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
134 \begin{funcdesc}{ftruncate}{fd\, length} |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
135 Truncate the file corresponding to file descriptor \var{fd}, |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
136 so that it is at most \var{length} bytes in size. |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
137 \end{funcdesc} |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
138 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
139 \begin{funcdesc}{getcwd}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
140 Return a string representing the current working directory. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
141 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
142 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
143 \begin{funcdesc}{getegid}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
144 Return the current process's effective group id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
145 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
146 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
147 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
148 \begin{funcdesc}{geteuid}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
149 Return the current process's effective user id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
150 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
151 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
152 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
153 \begin{funcdesc}{getgid}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
154 Return the current process's group id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
155 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
156 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
157 |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
158 \begin{funcdesc}{getpgrp}{} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
159 Return the current process group id. |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
160 (Not on MS-DOS.) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
161 \end{funcdesc} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
162 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
163 \begin{funcdesc}{getpid}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
164 Return the current process id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
165 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
166 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
167 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
168 \begin{funcdesc}{getppid}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
169 Return the parent's process id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
170 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
171 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
172 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
173 \begin{funcdesc}{getuid}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
174 Return the current process's user id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
175 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
176 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
177 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
178 \begin{funcdesc}{kill}{pid\, sig} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
179 Kill the process \var{pid} with signal \var{sig}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
180 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
181 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
182 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
183 \begin{funcdesc}{link}{src\, dst} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
184 Create a hard link pointing to \var{src} named \var{dst}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
185 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
186 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
187 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
188 \begin{funcdesc}{listdir}{path} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
189 Return a list containing the names of the entries in the directory. |
|
3376
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
190 The list is in arbitrary order. It does not include the special |
|
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
191 entries \code{'.'} and \code{'..'} even if they are present in the |
|
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
192 directory. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
193 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
194 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
195 \begin{funcdesc}{lseek}{fd\, pos\, how} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
196 Set the current position of file descriptor \var{fd} to position |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
197 \var{pos}, modified by \var{how}: 0 to set the position relative to |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
198 the beginning of the file; 1 to set it relative to the current |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
199 position; 2 to set it relative to the end of the file. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
200 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
201 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
202 \begin{funcdesc}{lstat}{path} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
203 Like \code{stat()}, but do not follow symbolic links. (On systems |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
204 without symbolic links, this is identical to \code{posix.stat}.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
205 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
206 |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
207 \begin{funcdesc}{mkfifo}{path\optional{\, mode}} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
208 Create a FIFO (a POSIX named pipe) named \var{path} with numeric mode |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
209 \var{mode}. The default \var{mode} is 0666 (octal). The current |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
210 umask value is first masked out from the mode. |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
211 (Not on MS-DOS.) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
212 |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
213 FIFOs are pipes that can be accessed like regular files. FIFOs exist |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
214 until they are deleted (for example with \code{os.unlink}). |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
215 Generally, FIFOs are used as rendez-vous between ``client'' and |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
216 ``server'' type processes: the server opens the FIFO for reading, and |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
217 the client opens it for writing. Note that \code{mkfifo()} doesn't |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
218 open the FIFO -- it just creates the rendez-vous point. |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
219 \end{funcdesc} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
220 |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
221 \begin{funcdesc}{mkdir}{path\optional{\, mode}} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
222 Create a directory named \var{path} with numeric mode \var{mode}. |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
223 The default \var{mode} is 0777 (octal). On some systems, \var{mode} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
224 is ignored. Where it is used, the current umask value is first |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
225 masked out. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
226 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
227 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
228 \begin{funcdesc}{nice}{increment} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
229 Add \var{incr} to the process' ``niceness''. Return the new niceness. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
230 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
231 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
232 |
|
4787
d7e6653d084f
posix.open(): third argument (mode) is optional.
Barry Warsaw <barry@python.org>
parents:
4728
diff
changeset
|
233 \begin{funcdesc}{open}{file\, flags\optional{\, mode}} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
234 Open the file \var{file} and set various flags according to |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
235 \var{flags} and possibly its mode according to \var{mode}. |
|
4787
d7e6653d084f
posix.open(): third argument (mode) is optional.
Barry Warsaw <barry@python.org>
parents:
4728
diff
changeset
|
236 The default \var{mode} is 0777 (octal), and the current umask value is |
|
d7e6653d084f
posix.open(): third argument (mode) is optional.
Barry Warsaw <barry@python.org>
parents:
4728
diff
changeset
|
237 first masked out. Return the file descriptor for the newly opened |
|
d7e6653d084f
posix.open(): third argument (mode) is optional.
Barry Warsaw <barry@python.org>
parents:
4728
diff
changeset
|
238 file. |
|
2137
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
239 |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
240 Note: this function is intended for low-level I/O. For normal usage, |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
241 use the built-in function \code{open}, which returns a ``file object'' |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
242 with \code{read()} and \code{write()} methods (and many more). |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
243 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
244 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
245 \begin{funcdesc}{pipe}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
246 Create a pipe. Return a pair of file descriptors \code{(r, w)} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
247 usable for reading and writing, respectively. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
248 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
249 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
250 |
| 3760 | 251 \begin{funcdesc}{plock}{op} |
| 252 Lock program segments into memory. The value of \var{op} | |
| 253 (defined in \code{<sys/lock.h>}) determines which segments are locked. | |
| 254 (Not on MS-DOS.) | |
| 255 \end{funcdesc} | |
| 256 | |
|
2137
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
257 \begin{funcdesc}{popen}{command\optional{\, mode\optional{\, bufsize}}} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
258 Open a pipe to or from \var{command}. The return value is an open |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
259 file object connected to the pipe, which can be read or written |
|
2137
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
260 depending on whether \var{mode} is \code{'r'} (default) or \code{'w'}. |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
261 The \var{bufsize} argument has the same meaning as the corresponding |
|
5462
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
262 argument to the built-in \code{open()} function. The exit status of |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
263 the command (encoded in the format specified for \code{wait()}) is |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
264 available as the return value of the \code{close()} method of the file |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
265 object. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
266 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
267 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
268 |
|
5680
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
269 \begin{funcdesc}{putenv}{varname\, value} |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
270 Set the environment variable named \var{varname} to the string \var{value}. |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
271 Such changes to the environment affect |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
272 subprocesses started with \code{os.system()}, \code{os.popen()} or |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
273 \code{os.fork()} and \code{os.execv()}. (Not on all systems.) |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
274 |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
275 When \code{putenv()} is |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
276 supported, assignments to items in \code{os.environ} are automatically |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
277 translated into corresponding calls to \code{os.putenv()}; however, |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
278 calls to \code{os.putenv()} don't update \code{os.environ}, so it is |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
279 actually preferable to assign to items of \code{os.environ}. |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
280 \end{funcdesc} |
|
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
281 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
282 \begin{funcdesc}{read}{fd\, n} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
283 Read at most \var{n} bytes from file descriptor \var{fd}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
284 Return a string containing the bytes read. |
|
2137
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
285 |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
286 Note: this function is intended for low-level I/O and must be applied |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
287 to a file descriptor as returned by \code{posix.open()} or |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
288 \code{posix.pipe()}. To read a ``file object'' returned by the |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
289 built-in function \code{open} or by \code{posix.popen} or |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
290 \code{posix.fdopen}, or \code{sys.stdin}, use its |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
291 \code{read()} or \code{readline()} methods. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
292 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
293 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
294 \begin{funcdesc}{readlink}{path} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
295 Return a string representing the path to which the symbolic link |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
296 points. (On systems without symbolic links, this always raises |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
297 \code{posix.error}.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
298 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
299 |
|
3376
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
300 \begin{funcdesc}{remove}{path} |
|
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
301 Remove the file \var{path}. See \code{rmdir} below to remove a directory. |
|
5680
12d64cdbaaa2
Added putenv, ftruncate (AMK).
Guido van Rossum <guido@python.org>
parents:
5462
diff
changeset
|
302 This is identical to the \code{unlink} function documented below. |
|
3376
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
303 \end{funcdesc} |
|
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
304 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
305 \begin{funcdesc}{rename}{src\, dst} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
306 Rename the file or directory \var{src} to \var{dst}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
307 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
308 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
309 \begin{funcdesc}{rmdir}{path} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
310 Remove the directory \var{path}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
311 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
312 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
313 \begin{funcdesc}{setgid}{gid} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
314 Set the current process's group id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
315 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
316 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
317 |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
318 \begin{funcdesc}{setpgrp}{} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
319 Calls the system call \code{setpgrp()} or \code{setpgrp(0, 0)} |
|
4728
b218f294b726
(lib<all sorts of stuff>.tex):
Fred Drake <fdrake@acm.org>
parents:
3760
diff
changeset
|
320 depending on which version is implemented (if any). See the \UNIX{} |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
321 manual for the semantics. |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
322 (Not on MS-DOS.) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
323 \end{funcdesc} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
324 |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
325 \begin{funcdesc}{setpgid}{pid\, pgrp} |
|
4728
b218f294b726
(lib<all sorts of stuff>.tex):
Fred Drake <fdrake@acm.org>
parents:
3760
diff
changeset
|
326 Calls the system call \code{setpgid()}. See the \UNIX{} manual for |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
327 the semantics. |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
328 (Not on MS-DOS.) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
329 \end{funcdesc} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
330 |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
331 \begin{funcdesc}{setsid}{} |
|
4728
b218f294b726
(lib<all sorts of stuff>.tex):
Fred Drake <fdrake@acm.org>
parents:
3760
diff
changeset
|
332 Calls the system call \code{setsid()}. See the \UNIX{} manual for the |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
333 semantics. |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
334 (Not on MS-DOS.) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
335 \end{funcdesc} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
336 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
337 \begin{funcdesc}{setuid}{uid} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
338 Set the current process's user id. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
339 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
340 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
341 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
342 \begin{funcdesc}{stat}{path} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
343 Perform a {\em stat} system call on the given path. The return value |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
344 is a tuple of at least 10 integers giving the most important (and |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
345 portable) members of the {\em stat} structure, in the order |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
346 \code{st_mode}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
347 \code{st_ino}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
348 \code{st_dev}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
349 \code{st_nlink}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
350 \code{st_uid}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
351 \code{st_gid}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
352 \code{st_size}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
353 \code{st_atime}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
354 \code{st_mtime}, |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
355 \code{st_ctime}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
356 More items may be added at the end by some implementations. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
357 (On MS-DOS, some items are filled with dummy values.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
358 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
359 Note: The standard module \code{stat} defines functions and constants |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
360 that are useful for extracting information from a stat structure. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
361 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
362 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
363 \begin{funcdesc}{symlink}{src\, dst} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
364 Create a symbolic link pointing to \var{src} named \var{dst}. (On |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
365 systems without symbolic links, this always raises |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
366 \code{posix.error}.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
367 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
368 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
369 \begin{funcdesc}{system}{command} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
370 Execute the command (a string) in a subshell. This is implemented by |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
371 calling the Standard C function \code{system()}, and has the same |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2137
diff
changeset
|
372 limitations. Changes to \code{posix.environ}, \code{sys.stdin} etc.\ are |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
373 not reflected in the environment of the executed command. The return |
|
5462
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
374 value is the exit status of the process encoded in the format |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
375 specified for \code{wait()}. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
376 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
377 |
|
3711
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
378 \begin{funcdesc}{tcgetpgrp}{fd} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
379 Return the process group associated with the terminal given by |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
380 \var{fd} (an open file descriptor as returned by \code{posix.open()}). |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
381 (Not on MS-DOS.) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
382 \end{funcdesc} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
383 |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
384 \begin{funcdesc}{tcsetpgrp}{fd\, pg} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
385 Set the process group associated with the terminal given by |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
386 \var{fd} (an open file descriptor as returned by \code{posix.open()}) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
387 to \var{pg}. |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
388 (Not on MS-DOS.) |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
389 \end{funcdesc} |
|
c04531fc2709
Document some process group stuff; mkdir mode arg optional; mkfifo.
Guido van Rossum <guido@python.org>
parents:
3376
diff
changeset
|
390 |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
391 \begin{funcdesc}{times}{} |
|
3083
07cb50141d07
add realtime as 5th item to os.times() return value
Guido van Rossum <guido@python.org>
parents:
2647
diff
changeset
|
392 Return a 5-tuple of floating point numbers indicating accumulated (CPU |
|
07cb50141d07
add realtime as 5th item to os.times() return value
Guido van Rossum <guido@python.org>
parents:
2647
diff
changeset
|
393 or other) |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
394 times, in seconds. The items are: user time, system time, children's |
|
3083
07cb50141d07
add realtime as 5th item to os.times() return value
Guido van Rossum <guido@python.org>
parents:
2647
diff
changeset
|
395 user time, children's system time, and elapsed real time since a fixed |
|
07cb50141d07
add realtime as 5th item to os.times() return value
Guido van Rossum <guido@python.org>
parents:
2647
diff
changeset
|
396 point in the past, in that order. See the \UNIX{} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
397 manual page {\it times}(2). (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
398 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
399 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
400 \begin{funcdesc}{umask}{mask} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
401 Set the current numeric umask and returns the previous umask. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
402 (Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
403 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
404 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
405 \begin{funcdesc}{uname}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
406 Return a 5-tuple containing information identifying the current |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
407 operating system. The tuple contains 5 strings: |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
408 \code{(\var{sysname}, \var{nodename}, \var{release}, \var{version}, \var{machine})}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
409 Some systems truncate the nodename to 8 |
|
2527
815dfaa6a778
small changes by Soren Larsen
Guido van Rossum <guido@python.org>
parents:
2137
diff
changeset
|
410 characters or to the leading component; a better way to get the |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
411 hostname is \code{socket.gethostname()}. (Not on MS-DOS, nor on older |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
412 \UNIX{} systems.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
413 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
414 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
415 \begin{funcdesc}{unlink}{path} |
|
3376
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
416 Remove the file \var{path}. This is the same function as \code{remove}; |
|
e0862f05e185
listdir no longer returns . or ..; added remove==unlink
Guido van Rossum <guido@python.org>
parents:
3083
diff
changeset
|
417 the \code{unlink} name is its traditional \UNIX{} name. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
418 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
419 |
|
5731
75762c67200c
Really nitty-gritty change to prevent latex2html from using a LaTeX-generated
Fred Drake <fdrake@acm.org>
parents:
5680
diff
changeset
|
420 \begin{funcdesc}{utime}{path\, {\rm (}atime, mtime{\rm )}} |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
421 Set the access and modified time of the file to the given values. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
422 (The second argument is a tuple of two items.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
423 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
424 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
425 \begin{funcdesc}{wait}{} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
426 Wait for completion of a child process, and return a tuple containing |
|
5462
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
427 its pid and exit status indication: a 16-bit number, whose low byte is |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
428 the signal number that killed the process, and whose high byte is the |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
429 exit status (if the signal number is zero); the high bit of the low |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
430 byte is set if a core file was produced. (Not on MS-DOS.) |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
431 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
432 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
433 \begin{funcdesc}{waitpid}{pid\, options} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
434 Wait for completion of a child process given by proces id, and return |
|
5462
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
435 a tuple containing its pid and exit status indication (encoded as for |
|
60f6649fd231
Document return value of wait[pid]() more carefully.
Guido van Rossum <guido@python.org>
parents:
4790
diff
changeset
|
436 \code{wait()}). The semantics of the call are affected by the value of |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
437 the integer options, which should be 0 for normal operation. (If the |
|
2647
9b7e6d9a528d
typos, layout and other small things
Guido van Rossum <guido@python.org>
parents:
2620
diff
changeset
|
438 system does not support \code{waitpid()}, this always raises |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
439 \code{posix.error}. Not on MS-DOS.) |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
440 \end{funcdesc} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
441 |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
442 \begin{funcdesc}{write}{fd\, str} |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
443 Write the string \var{str} to file descriptor \var{fd}. |
|
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
444 Return the number of bytes actually written. |
|
2137
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
445 |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
446 Note: this function is intended for low-level I/O and must be applied |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
447 to a file descriptor as returned by \code{posix.open()} or |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
448 \code{posix.pipe()}. To write a ``file object'' returned by the |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
449 built-in function \code{open} or by \code{posix.popen} or |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
450 \code{posix.fdopen}, or \code{sys.stdout} or \code{sys.stderr}, use |
|
c9085f1e977f
optional bufsize arg for popen and fdopen
Guido van Rossum <guido@python.org>
parents:
2064
diff
changeset
|
451 its \code{write()} method. |
|
1471
2ec96140a36b
Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
452 \end{funcdesc} |
| 2620 | 453 |
| 454 \begin{datadesc}{WNOHANG} | |
| 455 The option for \code{waitpid()} to avoid hanging if no child process | |
| 456 status is available immediately. | |
| 457 \end{datadesc} | |
|
4790
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
458 |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
459 |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
460 \begin{datadesc}{O_RDONLY} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
461 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
462 \begin{datadesc}{O_WRONLY} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
463 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
464 \begin{datadesc}{O_RDWR} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
465 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
466 \begin{datadesc}{O_NDELAY} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
467 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
468 \begin{datadesc}{O_NONBLOCK} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
469 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
470 \begin{datadesc}{O_APPEND} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
471 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
472 \begin{datadesc}{O_DSYNC} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
473 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
474 \begin{datadesc}{O_RSYNC} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
475 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
476 \begin{datadesc}{O_SYNC} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
477 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
478 \begin{datadesc}{O_NOCTTY} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
479 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
480 \begin{datadesc}{O_CREAT} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
481 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
482 \begin{datadesc}{O_EXCL} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
483 \end{datadesc} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
484 \begin{datadesc}{O_TRUNC} |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
485 Options for the \code{flag} argument to the \code{open()} function. |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
486 These can be bit-wise OR'd together. |
|
f37582314123
Describe open(2) exported constants
Barry Warsaw <barry@python.org>
parents:
4787
diff
changeset
|
487 \end{datadesc} |
