The ordering of returned files is unspecified for non-Unix
platforms; for more information, see glib.dir.Dir.readName. On Unix,
when operating on local files, returned files will be sorted by
inode number. Effectively you can assume that the ordering of
returned files will be stable between successive calls (and
applications) assuming the directory is unchanged.
If your application needs a specific ordering, such as by name or
modification time, you will have to implement that in your
application code.
gio.file_enumerator.FileEnumerator allows you to operate on a set of gio.file.File objects, returning a gio.file_info.FileInfo structure for each file enumerated (e.g. gio.file.File.enumerateChildren will return a gio.file_enumerator.FileEnumerator for each of the children within a directory).
To get the next file's information from a gio.file_enumerator.FileEnumerator, use gio.file_enumerator.FileEnumerator.nextFile or its asynchronous version, gio.file_enumerator.FileEnumerator.nextFilesAsync. Note that the asynchronous version will return a list of gio.file_info.FileInfo objects, whereas the synchronous will only return the next file in the enumerator.
The ordering of returned files is unspecified for non-Unix platforms; for more information, see glib.dir.Dir.readName. On Unix, when operating on local files, returned files will be sorted by inode number. Effectively you can assume that the ordering of returned files will be stable between successive calls (and applications) assuming the directory is unchanged.
If your application needs a specific ordering, such as by name or modification time, you will have to implement that in your application code.
To close a gio.file_enumerator.FileEnumerator, use gio.file_enumerator.FileEnumerator.close, or its asynchronous version, gio.file_enumerator.FileEnumerator.closeAsync. Once a gio.file_enumerator.FileEnumerator is closed, no further actions may be performed on it, and it should be freed with gobject.object.ObjectG.unref.