[Python-checkins] CVS: python/dist/src/Doc/lib libos.tex,1.47,1.48 libpopen2.tex,1.12,1.13
Fred L. Drake
python-dev@python.org
Thu, 28 Sep 2000 13:27:55 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv16543
Modified Files:
libos.tex libpopen2.tex
Log Message:
Updated documentation relating to the various flavors of popen[234]()
for Windows & Unix.
Index: libos.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** libos.tex 2000/09/23 05:22:07 1.47
--- libos.tex 2000/09/28 20:27:51 1.48
***************
*** 297,300 ****
--- 297,330 ----
+ For each of these \function{popen()} variants, if \var{bufsize} is
+ specified, it specifies the buffer size for the I/O pipes.
+ \var{mode}, if provided, should be the string \code{'b'} or
+ \code{'t'}; on Windows this is needed to determine whether the file
+ objects should be opened in binary or text mode. The default value
+ for \var{mode} is \code{'t'}.
+
+ \begin{funcdesc}{popen2}{cmd\optional{, bufsize\optional{, mode}}}
+ Executes \var{cmd} as a sub-process. Returns the file objects
+ \code{(\var{child_stdin}, \var{child_stdout})}.
+ \versionadded{2.0}
+ \end{funcdesc}
+
+ \begin{funcdesc}{popen3}{cmd\optional{, bufsize\optional{, mode}}}
+ Executes \var{cmd} as a sub-process. Returns the file objects
+ \code{(\var{child_stdin}, \var{child_stdout}, \var{child_stderr})}.
+ \versionadded{2.0}
+ \end{funcdesc}
+
+ \begin{funcdesc}{popen4}{cmd\optional{, bufsize\optional{, mode}}}
+ Executes \var{cmd} as a sub-process. Returns the file objects
+ \code{(\var{child_stdin}, \var{child_stdout_and_stderr})}.
+ \versionadded{2.0}
+ \end{funcdesc}
+
+ This functionality is also available in the \refmodule{popen2} module
+ using functions of the same names, but the return values of those
+ functions have a different order.
+
+
\subsection{File Descriptor Operations \label{os-fd-ops}}
Index: libpopen2.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpopen2.tex,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** libpopen2.tex 1999/08/19 17:00:38 1.12
--- libpopen2.tex 2000/09/28 20:27:51 1.13
***************
*** 3,39 ****
\declaremodule{standard}{popen2}
! \platform{Unix}
\modulesynopsis{Subprocesses with accessible standard I/O streams.}
\sectionauthor{Drew Csillag}{drew_csillag@geocities.com}
! This module allows you to spawn processes and connect their
! input/output/error pipes and obtain their return codes under \UNIX.
! Similar functionality exists for Windows platforms using the
! \module{win32pipe} module provided as part of Mark Hammond's Windows
! extensions.
!
! The primary interface offered by this module is a pair of factory
! functions:
!
! \begin{funcdesc}{popen2}{cmd\optional{, bufsize}}
! Executes \var{cmd} as a sub-process. If \var{bufsize} is specified,
! it specifies the buffer size for the I/O pipes. Returns the file
! objects \code{(\var{child_stdout}, \var{child_stdin})}.
\end{funcdesc}
! \begin{funcdesc}{popen3}{cmd\optional{, bufsize}}
! Executes \var{cmd} as a sub-process. If \var{bufsize} is specified,
! it specifies the buffer size for the I/O pipes. Returns the file
! objects \code{(\var{child_stdout}, \var{child_stdin},
! \var{child_stderr})}.
\end{funcdesc}
! The class defining the objects returned by the factory functions is
! also available:
\begin{classdesc}{Popen3}{cmd\optional{, capturestderr\optional{, bufsize}}}
This class represents a child process. Normally, \class{Popen3}
! instances are created using the factory functions described above.
If not using one off the helper functions to create \class{Popen3}
--- 3,53 ----
\declaremodule{standard}{popen2}
! \platform{Unix, Windows}
\modulesynopsis{Subprocesses with accessible standard I/O streams.}
\sectionauthor{Drew Csillag}{drew_csillag@geocities.com}
! This module allows you to spawn processes and connect to their
! input/output/error pipes and obtain their return codes under
! \UNIX{} and Windows.
!
! Note that starting with Python 2.0, this functionality is available
! using functions from the \refmodule{os} module which have the same
! names as the factory functions here, but the order of the return
! values is more intuitive in the \refmodule{os} module variants.
!
! The primary interface offered by this module is a trio of factory
! functions. For each of these, if \var{bufsize} is specified,
! it specifies the buffer size for the I/O pipes. \var{mode}, if
! provided, should be the string \code{'b'} or \code{'t'}; on Windows
! this is needed to determine whether the file objects should be opened
! in binary or text mode. The default value for \var{mode} is
! \code{'t'}.
!
! \begin{funcdesc}{popen2}{cmd\optional{, bufsize\optional{, mode}}}
! Executes \var{cmd} as a sub-process. Returns the file objects
! \code{(\var{child_stdout}, \var{child_stdin})}.
\end{funcdesc}
! \begin{funcdesc}{popen3}{cmd\optional{, bufsize\optional{, mode}}}
! Executes \var{cmd} as a sub-process. Returns the file objects
! \code{(\var{child_stdout}, \var{child_stdin}, \var{child_stderr})}.
\end{funcdesc}
! \begin{funcdesc}{popen4}{cmd\optional{, bufsize\optional{, mode}}}
! Executes \var{cmd} as a sub-process. Returns the file objects
! \code{(\var{child_stdout_and_stderr}, \var{child_stdin})}.
! \versionadded{2.0}
! \end{funcdesc}
!
!
! On \UNIX, a class defining the objects returned by the factory
! functions is also available. These are not used for the Windows
! implementation, and are not available on that platform.
\begin{classdesc}{Popen3}{cmd\optional{, capturestderr\optional{, bufsize}}}
This class represents a child process. Normally, \class{Popen3}
! instances are created using the \function{popen2()} and
! \function{popen3()} factory functions described above.
If not using one off the helper functions to create \class{Popen3}
***************
*** 45,52 ****
\end{classdesc}
! \subsection{Popen3 Objects \label{popen3-objects}}
! Instances of the \class{Popen3} class have the following methods:
\begin{methoddesc}{poll}{}
--- 59,74 ----
\end{classdesc}
+ \begin{classdesc}{Popen4}{cmd\optional{, bufsize}}
+ Similar to \class{Popen3}, but always captures standard error into the
+ same file object as standard output. These are typically created
+ using \function{popen4()}.
+ \versionadded{2.0}
+ \end{classdesc}
+
! \subsection{Popen3 and Popen4 Objects \label{popen3-objects}}
! Instances of the \class{Popen3} and \class{Popen4} classes have the
! following methods:
\begin{methoddesc}{poll}{}
***************
*** 60,67 ****
! The following attributes of \class{Popen3} objects are also available:
\begin{memberdesc}{fromchild}
! A file object that provides output from the child process.
\end{memberdesc}
--- 82,91 ----
! The following attributes are also available:
\begin{memberdesc}{fromchild}
! A file object that provides output from the child process. For
! \class{Popen4} instances, this will provide both the standard output
! and standard error streams.
\end{memberdesc}
***************
*** 73,76 ****
--- 97,101 ----
Where the standard error from the child process goes is
\var{capturestderr} was true for the constructor, or \code{None}.
+ This will always be \code{None} for \class{Popen4} instances.
\end{memberdesc}