The module defines the following user-callable functions:
-\begin{funcdesc}{TemporaryFile}{\optional{mode='w+b'}
- \optional{, bufsize=-1}
- \optional{, suffix}
- \optional{, prefix}
- \optional{, dir}}
+\begin{funcdesc}{TemporaryFile}{\optional{mode=\code{'w+b'}\optional{,
+ bufsize=\code{-1}\optional{,
+ suffix\optional{, prefix\optional{, dir}}}}}}
Return a file (or file-like) object that can be used as a temporary
storage area. The file is created using \function{mkstemp}. It will
be destroyed as soon as it is closed (including an implicit close when
\function{mkstemp()}.
\end{funcdesc}
-\begin{funcdesc}{NamedTemporaryFile}{\optional{mode='w+b'}
- \optional{, bufsize=-1}
- \optional{, suffix}
- \optional{, prefix}
- \optional{, dir}}
+\begin{funcdesc}{NamedTemporaryFile}{\optional{mode=\code{'w+b'}\optional{,
+ bufsize=\code{-1}\optional{,
+ suffix\optional{, prefix\optional{,
+ dir}}}}}}
This function operates exactly as \function{TemporaryFile()} does,
except that the file is guaranteed to have a visible name in the file
system (on \UNIX, the directory entry is not unlinked). That name can
\versionadded{2.3}
\end{funcdesc}
-\begin{funcdesc}{mkstemp}{\optional{suffix}
- \optional{, prefix}
- \optional{, dir}
- \optional{, text=False}}
+\begin{funcdesc}{mkstemp}{\optional{suffix\optional{,
+ prefix\optional{, dir\optional{, text}}}}}
Creates a temporary file in the most secure manner possible. There
are no race conditions in the file's creation, assuming that the
platform properly implements the \constant{O_EXCL} flag for
\versionadded{2.3}
\end{funcdesc}
-\begin{funcdesc}{mkdtemp}{\optional{suffix}
- \optional{, prefix}
- \optional{, dir}}
+\begin{funcdesc}{mkdtemp}{\optional{suffix\optional{, prefix\optional{, dir}}}}
Creates a temporary directory in the most secure manner possible.
There are no race conditions in the directory's creation. The
directory is readable, writable, and searchable only by the
\versionadded{2.3}
\end{funcdesc}
-\begin{funcdesc}{mktemp}{\optional{suffix}
- \optional{, prefix}
- \optional{, dir}}
+\begin{funcdesc}{mktemp}{\optional{suffix\optional{, prefix\optional{, dir}}}}
\deprecated{2.3}{Use \function{mkstemp()} instead.}
Return an absolute pathname of a file that did not exist at the time
the call is made. The \var{prefix}, \var{suffix}, and \var{dir}
default value for the \var{dir} argument to all the functions defined
in this module.
-If \var{tempdir} is unset or \code{None} at any call to any of the
+If \code{tempdir} is unset or \code{None} at any call to any of the
above functions, Python searches a standard list of directories and
sets \var{tempdir} to the first one which the calling user can create
files in. The list is:
\begin{funcdesc}{gettempdir}{}
Return the directory currently selected to create temporary files in.
-If \var{tempdir} is not None, this simply returns its contents;
+If \code{tempdir} is not \code{None}, this simply returns its contents;
otherwise, the search described above is performed, and the result
returned.
\end{funcdesc}