FileEnumerator
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.
Skipped during bindings generation
parameter
out_info
: out_info: Out parameter is not supportedmethod
container
: Property has no getter nor setter
Constructors
Functions
Releases all resources used by this enumerator, making the enumerator return %G_IO_ERROR_CLOSED on all calls.
Asynchronously closes the file enumerator.
Finishes closing a file enumerator, started from g_file_enumerator_close_async().
Get the #GFile container which is being enumerated.
Checks if the file enumerator has pending operations.
Returns information for the next file in the enumerated object. Will block until the information is available. The #GFileInfo returned from this function will contain attributes that match the attribute string that was passed when the #GFileEnumerator was created.
Request information for a number of files from the enumerator asynchronously. When all I/O for the operation is finished the @callback will be called with the requested information.
Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
Sets the file enumerator as having pending operations.