Skip to content
Snippets Groups Projects
Select Git revision
  • dualcore
  • ch3/leds
  • wip-bootstrap default
  • ch3/time
  • master
5 results

modos.c

Blame
    • Paul Sokolovsky's avatar
      d874702f
      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
      History
      unix/modos: Implement ilistdir().
      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().