Skip to content

Commit 6d221fe

Browse files
committed
docs/library/uos: Add description of uos.ilistdir() function.
1 parent d70f688 commit 6d221fe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/library/uos.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ Functions
3737

3838
Get the current directory.
3939

40+
.. function:: ilistdir([dir])
41+
42+
This function returns an iterator which then yields 3-tuples corresponding to
43+
the entries in the directory that it is listing. With no argument it lists the
44+
current directory, otherwise it lists the directory given by `dir`.
45+
46+
The 3-tuples have the form `(name, type, inode)`:
47+
48+
- `name` is a string (or bytes if `dir` is a bytes object) and is the name of
49+
the entry;
50+
- `type` is an integer that specifies the type of the entry, with 0x4000 for
51+
directories and 0x8000 for regular files;
52+
- `inode` is an integer corresponding to the inode of the file, and may be 0
53+
for filesystems that don't have such a notion.
54+
4055
.. function:: listdir([dir])
4156

4257
With no argument, list the current directory. Otherwise list the given directory.

0 commit comments

Comments
 (0)