Method

GioFileEnumeratorget_child

since: 2.36

Declaration [src]

GFile*
g_file_enumerator_get_child (
  GFileEnumerator* enumerator,
  GFileInfo* info
)

Description [src]

Returns a new GFile which refers to the file named by info in the source directory of enumerator.

This function is primarily intended to be used inside loops with g_file_enumerator_next_file().

To use this, G_FILE_ATTRIBUTE_STANDARD_NAME must have been listed in the attributes list used when creating the GFileEnumerator.

This is a convenience method that’s equivalent to:

char *name = g_file_info_get_name (info);
GFile *child = g_file_get_child (g_file_enumerator_get_container (enumerator), name);

Available since: 2.36

Parameters

info

Type: GFileInfo

A file info object received from g_file_enumerator_next_file() or the async equivalent.

The data is owned by the caller of the method.

Return value

Type: GFile

A file object for the file info object passed to it.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.