summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-07-24 20:48:20 (GMT)
committerGuido van Rossum <guido@python.org>1998-07-24 20:48:20 (GMT)
commit89a79d19b7be960a9b6b00cfd034052ead9f4c6d (patch)
tree5ae42223600c62c2eb1a11b72ddc6fee89070528 /Doc/lib
parent4def7de7c6b87e2c46e6e6428ba113b4367fc3c4 (diff)
downloadcpython-89a79d19b7be960a9b6b00cfd034052ead9f4c6d.zip
cpython-89a79d19b7be960a9b6b00cfd034052ead9f4c6d.tar.gz
cpython-89a79d19b7be960a9b6b00cfd034052ead9f4c6d.tar.bz2
Document makedirs(), removedirs(), renames() -- ESR-inspired super-versions
of mkdir(), rmdir() and rename() that make or remove intermediate directories as well.
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libos.tex31
1 files changed, 30 insertions, 1 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex
index b9f3f20..b0ca13f 100644
--- a/Doc/lib/libos.tex
+++ b/Doc/lib/libos.tex
@@ -68,7 +68,7 @@ or \code{None} if only one separator character exists. This is set to
\begin{datadesc}{pathsep}
The character conventionally used by the OS to separate search patch
-components (as in \code{\$PATH}), e.g.\ \code{':'} for \POSIX{} or
+components (as in \code{\$PATH}), e.g.\ \code{':'} for \POSIX{} or % $
\code{';'} for MS-DOS.
\end{datadesc}
@@ -84,6 +84,35 @@ The default search path used by \code{exec*p*()} if the environment
doesn't have a \code{'PATH'} key.
\end{datadesc}
+\begin{funcdesc}{makedirs}{path\optional{, mode}}
+Recursive directory creation function. Like \function{mkdir()},
+but makes all intermediate-level directories needed to contain the
+leaf directory. Throws an \exception{os.error} exception if the leaf
+directory already exists or cannot be created. The default \var{mode}
+is \code{0777} (octal).
+\end{funcdesc}
+
+\begin{funcdesc}{removedirs}{path}
+Recursive directory removal function. Works like
+\function{rmdir()} except that, if the leaf directory is
+successfully removed, directories corresponding to rightmost path
+segments will be pruned way until either the whole path is consumed or
+an error is raised (which is ignored, because it generally means that
+a parent directory is not empty). Throws an \exception{os.error}
+exception if the leaf directory could not be successfully removed.
+\end{funcdesc}
+
+\begin{funcdesc}{renames}{path}
+Recursive directory or file renaming function.
+Works like \function{rename()}, except creation of any intermediate
+directories needed to make the new pathname good is attempted first.
+After the rename, directories corresponding to rightmost path segments
+of the old name will be pruned away using \function{removedirs()}.
+
+Note: this function can fail with the new directory structure made if
+you lack permissions needed to remove the leaf directory or file.
+\end{funcdesc}
+
\begin{funcdesc}{execl}{path, arg0, arg1, ...}
This is equivalent to
\code{execv(\var{path}, (\var{arg0}, \var{arg1}, ...))}.