Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2194a4ee
Commit
2194a4ee
authored
Apr 25, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
markup adjustments
parent
1448d471
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
Doc/lib/libos.tex
Doc/lib/libos.tex
+4
-5
No files found.
Doc/lib/libos.tex
View file @
2194a4ee
...
...
@@ -1050,10 +1050,9 @@ which is used to set the access and modified times, respectively.
Availability: Macintosh,
\UNIX
, Windows.
\end{funcdesc}
\begin{funcdesc}
{
walk
}{
top
\optional
{
, topdown
=True
}}
\begin{funcdesc}
{
walk
}{
top
\optional
{
, topdown
\code
{
=True
}
}}
\index
{
directory!walking
}
\index
{
directory!traversal
}
\function
{
walk()
}
generates the file names in a directory tree.
For each directory in the tree rooted at directory
\var
{
top
}
(including
\var
{
top
}
itself), it yields a 3-tuple
...
...
@@ -1064,7 +1063,7 @@ a list of the names of the subdirectories in \var{dirpath}
(excluding
\code
{
'.'
}
and
\code
{
'..'
}
).
\var
{
filenames
}
is a list of
the names of the non-directory files in
\var
{
dirpath
}
. Note that the
names in the lists contain no path components. To get a full
path (which begins with
\var
{
top
)
) to a file or directory in
path (which begins with
\var
{
top
}
) to a file or directory in
\var
{
dirpath
}
, do
\code
{
os.path.join(
\var
{
dirpath
}
,
\var
{
name
}
)
}
.
If optional argument
\var
{
topdown
}
is true or not specified, the triple
...
...
@@ -1085,7 +1084,7 @@ false is ineffective, because in bottom-up mode the directories in
\begin{notice}
If you pass a relative pathname, don't change the current working
directory between resumptions of
\function
{
walk
}
.
\function
{
walk
}
directory between resumptions of
\function
{
walk
()
}
.
\function
{
walk()
}
never changes the current directory, and assumes that its caller
doesn't either.
\end{notice}
...
...
@@ -1095,7 +1094,7 @@ 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
\
function
{
walk(
\var
{
path
}
)
}
\code
{
os.path.islink(
\var
{
path
}
)
}
, and invoke
\
code
{
walk(
\var
{
path
}
)
}
on each directly.
\end{notice}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment