FileEnumerator


Object Hierarchy:

Object hierarchy for FileEnumerator

Description:

[ CCode ( type_id = "g_file_enumerator_get_type ()" ) ]
public class FileEnumerator : Object

`GFileEnumerator` allows you to operate on a set of [iface@Gio.

File] objects, returning a [class@Gio.FileInfo] structure for each file enumerated (e.g. [method@Gio.File.enumerate_children] will return a `GFileEnumerator` for each of the children within a directory).

To get the next file's information from a `GFileEnumerator`, use [method@Gio.FileEnumerator.next_file] or its asynchronous version, [ method@Gio.FileEnumerator.next_files_async]. Note that the asynchronous version will return a list of [class@Gio.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 [method@GLib.Dir.read_name]. 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 `GFileEnumerator`, use [method@Gio.FileEnumerator.close], or its asynchronous version, [method@Gio.FileEnumerator.close_async] . Once a `GFileEnumerator` is closed, no further actions may be performed on it, and it should be freed with [method@GObject.Object.unref] .


Namespace: GLib
Package: gio-2.0

Content:

Properties:

Creation methods:

Methods:

Inherited Members: