Source

fsnix / doc / source / fsnix-util.rst

Full commit

fsnix.util - Higher Level Tools

Module API

Directory Objects

You should not try to instantiate a directory object directly. Instead, use :func:`opendir`, :func:`opendirat`, or :func:`fdopendir`.

Directory objects are intended to mimic the API of Python file objects to a limited degree. They are context managers and support the fileno method to get the file descriptor value. Instead of supporting IO methods some simple directory listing wrappers are supported.