diff options
author | Damien George <damien.p.george@gmail.com> | 2017-05-10 12:44:21 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-05-10 12:44:21 +1000 |
commit | 6d221fe284f977dbf55fd4668efae281b045c237 (patch) | |
tree | 93ab8a92f5da0e8c24d0e3a867083c389d5406c9 | |
parent | d70f688f25a76e1e6a251a4ffc5144539c1a4e64 (diff) | |
download | micropython-6d221fe284f977dbf55fd4668efae281b045c237.tar.gz micropython-6d221fe284f977dbf55fd4668efae281b045c237.zip |
docs/library/uos: Add description of uos.ilistdir() function.
-rw-r--r-- | docs/library/uos.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/library/uos.rst b/docs/library/uos.rst index e1ea72967f..d1f83d2cc3 100644 --- a/docs/library/uos.rst +++ b/docs/library/uos.rst @@ -37,6 +37,21 @@ Functions Get the current directory. +.. function:: ilistdir([dir]) + + This function returns an iterator which then yields 3-tuples corresponding to + the entries in the directory that it is listing. With no argument it lists the + current directory, otherwise it lists the directory given by `dir`. + + The 3-tuples have the form `(name, type, inode)`: + + - `name` is a string (or bytes if `dir` is a bytes object) and is the name of + the entry; + - `type` is an integer that specifies the type of the entry, with 0x4000 for + directories and 0x8000 for regular files; + - `inode` is an integer corresponding to the inode of the file, and may be 0 + for filesystems that don't have such a notion. + .. function:: listdir([dir]) With no argument, list the current directory. Otherwise list the given directory. |