Class
GioFileEnumerator
Description [src]
class Gio.FileEnumerator : GObject.Object
{
/* No available fields */
}
GFileEnumerator allows you to operate on a set of GFile objects,
returning a GFileInfo structure for each file enumerated (e.g.
g_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
g_file_enumerator_next_file() or its asynchronous version,
g_file_enumerator_next_files_async(). Note that the asynchronous
version will return a list of GFileInfo 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 g_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 g_file_enumerator_close(), or
its asynchronous version, g_file_enumerator_close_async(). Once a GFileEnumerator is closed, no further actions may be performed
on it, and it should be freed with g_object_unref().
Instance methods
g_file_enumerator_close_finish
Finishes closing a file enumerator, started by
g_file_enumerator_close_async().
g_file_enumerator_get_child
Returns a new GFile which refers to the file named by info in the
source directory of enumerator.
since: 2.36
g_file_enumerator_iterate
A version of g_file_enumerator_next_file() that’s easier to use
correctly from C programs.
since: 2.44
g_file_enumerator_next_files_async
Request information for a number of files from the enumerator asynchronously.
g_file_enumerator_next_files_finish
Finishes the asynchronous operation started with [method@Gio.FileEnumerator.next_files_async()].
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct GioFileEnumeratorClass {
GObjectClass parent_class;
GFileInfo* (* next_file) (
GFileEnumerator* enumerator,
GCancellable* cancellable,
GError** error
);
gboolean (* close_fn) (
GFileEnumerator* enumerator,
GCancellable* cancellable,
GError** error
);
void (* next_files_async) (
GFileEnumerator* enumerator,
int num_files,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
GList* (* next_files_finish) (
GFileEnumerator* enumerator,
GAsyncResult* result,
GError** error
);
void (* close_async) (
GFileEnumerator* enumerator,
int io_priority,
GCancellable* cancellable,
GAsyncReadyCallback callback,
gpointer user_data
);
gboolean (* close_finish) (
GFileEnumerator* enumerator,
GAsyncResult* result,
GError** error
);
void (* _g_reserved1) (
void
);
void (* _g_reserved2) (
void
);
void (* _g_reserved3) (
void
);
void (* _g_reserved4) (
void
);
void (* _g_reserved5) (
void
);
void (* _g_reserved6) (
void
);
void (* _g_reserved7) (
void
);
}
No description available.
Class members
parent_class: GObjectClassNo description available.
next_file: GFileInfo* (* next_file) ( GFileEnumerator* enumerator, GCancellable* cancellable, GError** error )No description available.
close_fn: gboolean (* close_fn) ( GFileEnumerator* enumerator, GCancellable* cancellable, GError** error )No description available.
next_files_async: void (* next_files_async) ( GFileEnumerator* enumerator, int num_files, int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data )No description available.
next_files_finish: GList* (* next_files_finish) ( GFileEnumerator* enumerator, GAsyncResult* result, GError** error )No description available.
close_async: void (* close_async) ( GFileEnumerator* enumerator, int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data )No description available.
close_finish: gboolean (* close_finish) ( GFileEnumerator* enumerator, GAsyncResult* result, GError** error )No description available.
_g_reserved1: void (* _g_reserved1) ( void )No description available.
_g_reserved2: void (* _g_reserved2) ( void )No description available.
_g_reserved3: void (* _g_reserved3) ( void )No description available.
_g_reserved4: void (* _g_reserved4) ( void )No description available.
_g_reserved5: void (* _g_reserved5) ( void )No description available.
_g_reserved6: void (* _g_reserved6) ( void )No description available.
_g_reserved7: void (* _g_reserved7) ( void )No description available.
Virtual methods
Gio.FileEnumeratorClass.close_finish
Finishes closing a file enumerator, started by
g_file_enumerator_close_async().
Gio.FileEnumeratorClass.next_files_async
Request information for a number of files from the enumerator asynchronously.
Gio.FileEnumeratorClass.next_files_finish
Finishes the asynchronous operation started with [method@Gio.FileEnumerator.next_files_async()].