diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-03-20 05:23:09 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-03-20 05:23:09 (GMT) |
commit | c990f6454f2725c143f215d49de305ecb2a935e0 (patch) | |
tree | 46daae0bd01cacc40b7972925192c18c398acbfe /Doc/lib | |
parent | c473d5ebabae4375f767ae1125e1b28809d45701 (diff) | |
download | cpython-c990f6454f2725c143f215d49de305ecb2a935e0.zip cpython-c990f6454f2725c143f215d49de305ecb2a935e0.tar.gz cpython-c990f6454f2725c143f215d49de305ecb2a935e0.tar.bz2 |
Try backing out 54407 to see if it corrects the problems on the Windows
buildbots. This rev was backported, so we will need to keep both branches
in sync, pending the outcome of the test after this checkin.
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libos.tex | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex index 638ed6b..1a39693 100644 --- a/Doc/lib/libos.tex +++ b/Doc/lib/libos.tex @@ -1233,8 +1233,7 @@ Availability: Macintosh, \UNIX, Windows. \end{funcdesc} \begin{funcdesc}{walk}{top\optional{, topdown\code{=True} - \optional{, onerror\code{=None}\optional{, - followlinks\code{=False}}}}} + \optional{, onerror\code{=None}}}} \index{directory!walking} \index{directory!traversal} \function{walk()} generates the file names in a directory tree, by @@ -1274,25 +1273,24 @@ report the error to continue with the walk, or raise the exception to abort the walk. Note that the filename is available as the \code{filename} attribute of the exception object. -By default, \function{walk()} will not walk down into symbolic links that -resolve to directories. Set \var{followlinks} to True to visit directories -pointed to by symlinks, on systems that support them. - \versionadded[The \var{followlinks} parameter]{2.6} \begin{notice} -Be aware that setting \var{followlinks} to true can lead to infinite recursion -if a link points to a parent directory of itself. \function{walk()} does not -keep track of the directories it visited already. -\end{notice} - -\begin{notice} If you pass a relative pathname, don't change the current working directory between resumptions of \function{walk()}. \function{walk()} never changes the current directory, and assumes that its caller doesn't either. \end{notice} +\begin{notice} +On systems that support symbolic links, links to subdirectories appear +in \var{dirnames} lists, but \function{walk()} will not visit them +(infinite loops are hard to avoid when following symbolic links). +To visit linked directories, you can identify them with +\code{os.path.islink(\var{path})}, and invoke \code{walk(\var{path})} +on each directly. +\end{notice} + This example displays the number of bytes taken by non-directory files in each directory under the starting directory, except that it doesn't look under any CVS subdirectory: |