unix/modos: Implement ilistdir().
ilistdir() returns iterator which yields triples of (name, type, ino) where ino is inode number for entry's data, type of entry (file/dir/etc.), and name of file/dir. listdir() can be easily implemented in terms of this iterator (which is otherwise more efficient in terms of memory use and may save expensive call to stat() for each returned entry). CPython has os.scandir() which also returns an iterator, but it yields more complex objects of DirEntry type. scandir() can also be easily implemented in terms of ilistdir().
Showing
Please register or sign in to comment