Skip to content
  • Paul Sokolovsky's avatar
    unix/modos: Implement ilistdir(). · d874702f
    Paul Sokolovsky authored
    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().
    d874702f