Skip to content

gio: add g_file_enumerator_enumerate_children()

Christian Hergert requested to merge wip/chergert/enumerate-children into master

This adds the necessary functions to create an emumerator to enumerate children directly from another enumerator. Doing so allows for the use of openat() using the directory FD. This ensures that enumeration may still succeed even though a parent directory could have been moved in the process. It also may potentially reduce the overhead on accessing the child directory handle on some file-systems.

An implementation for GLocalFile is provided when on unix systems supporting openat() with O_DIRECTORY.

It may be interesting for GFileEnumerator to gain additional operations such as move, delete, or create in the future so that the directory fd may be used there as well. Requiring the round-trip to a GFile can be an inherent race. However, to do this, we probably want additional file operation interfaces that can be implemented by enumerators as we will run out of padding quickly.

Fixes #1745 (closed)

Merge request reports