@@ -13,7 +13,9 @@ \section{Built-in Module \sectcode{posix}}
1313\code {posix} module is not available, but a subset is always available
1414through the \code {os} interface. Once \code {os} is imported, there is
1515\emph {no } performance penalty in using it instead of
16- \code {posix}.
16+ \code {posix}. In addition, \code {os} provides some additional
17+ functionality, such as automatically calling \code {putenv()}
18+ when an entry is \code {os.environ} is changed.
1719\stmodindex {os}
1820
1921The descriptions below are very terse; refer to the
@@ -35,13 +37,17 @@ \section{Built-in Module \sectcode{posix}}
3537is the pathname of your home directory, equivalent to
3638\code {getenv("HOME")}
3739in C.
40+
3841Modifying this dictionary does not affect the string environment
3942passed on by \code {execv()}, \code {popen()} or \code {system()}; if you
4043need to change the environment, pass \code {environ} to \code {execve()}
4144or add variable assignments and export statements to the command
42- string for \code {system()} or \code {popen()}.%
43- \footnote {The problem with automatically passing on \code {environ} is
44- that there is no portable way of changing the environment.}
45+ string for \code {system()} or \code {popen()}.
46+
47+ \emph {However: } If you are using this module via the \code {os} module
48+ (as you should -- see the introduction above), \code {environ} is a
49+ a mapping object that behaves almost like a dictionary but invokes
50+ \code {putenv()} automatically called whenever an item is changed.
4551\end {datadesc }
4652
4753\renewcommand {\indexsubitem }{(exception in module posix)}
@@ -238,6 +244,10 @@ \section{Built-in Module \sectcode{posix}}
238244first masked out. Return the file descriptor for the newly opened
239245file.
240246
247+ For a description of the flag and mode values, see the \UNIX {} or C
248+ run-time documentation; flag constants (like \code {O_RDONLY} and
249+ \code {O_WRONLY}) are defined in this module too (see below).
250+
241251Note: this function is intended for low-level I/O. For normal usage,
242252use the built-in function \code {open}, which returns a `` file object''
243253with \code {read()} and \code {write()} methods (and many more).
0 commit comments