![]() |
![]() |
![]() |
GIO Reference Manual | ![]() |
---|---|---|---|---|
GFileEnumerator; GFileInfo* g_file_enumerator_next_file (GFileEnumerator *enumerator, GCancellable *cancellable, GError **error); gboolean g_file_enumerator_close (GFileEnumerator *enumerator, GCancellable *cancellable, GError **error); void g_file_enumerator_next_files_async (GFileEnumerator *enumerator, int num_files, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GList* g_file_enumerator_next_files_finish (GFileEnumerator *enumerator, GAsyncResult *result, GError **error); void g_file_enumerator_close_async (GFileEnumerator *enumerator, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator, GAsyncResult *result, GError **error); gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator); gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator); void g_file_enumerator_set_pending (GFileEnumerator *enumerator, gboolean pending);
GFileInfo* g_file_enumerator_next_file (GFileEnumerator *enumerator, GCancellable *cancellable, GError **error);
Returns information for the next file in the enumerated object. Will block until the information is available.
On error, returns NULL
and sets error
to the error. If the
enumerator is at the end, NULL
will be returned and error
will
be unset.
|
a GFileEnumerator. |
|
optional GCancellable object, NULL to ignore.
|
|
location to store the error occuring, or NULL to ignore
|
Returns : |
A GFileInfo or NULL on error or end of enumerator
|
gboolean g_file_enumerator_close (GFileEnumerator *enumerator, GCancellable *cancellable, GError **error);
Releases all resources used by this enumerator, making the
enumerator return G_IO_ERROR_CLOSED
on all calls.
This will be automatically called when the last reference is dropped, but you might want to call make sure resources are released as early as possible.
|
a GFileEnumerator. |
|
optional GCancellable object, NULL to ignore.
|
|
location to store the error occuring, or NULL to ignore
|
Returns : |
TRUE on success or FALSE on error. |
void g_file_enumerator_next_files_async (GFileEnumerator *enumerator, int num_files, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
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.
The callback can be called with less than num_files
files in case of error
or at the end of the enumerator. In case of a partial error the callback will
be called with any succeeding items and no error, and on the next request the
error will be reported. If a request is cancelled the callback will be called
with G_IO_ERROR_CANCELLED
.
During an async request no other sync and async calls are allowed, and will
result in G_IO_ERROR_PENDING
errors.
Any outstanding i/o request with higher priority (lower numerical value) will
be executed before an outstanding request with lower priority. Default
priority is G_PRIORITY_DEFAULT
.
|
a GFileEnumerator. |
|
the number of file info objects to request |
|
the io priority of the request. the io priority of the request |
|
optional GCancellable object, NULL to ignore.
|
|
callback to call when the request is satisfied |
|
the user_data to pass to callback function |
GList* g_file_enumerator_next_files_finish (GFileEnumerator *enumerator, GAsyncResult *result, GError **error);
|
a GFileEnumerator. |
|
a GAsyncResult. |
|
a GError location to store the error occuring, or NULL to
ignore.
Returns:
|
Returns : |
void g_file_enumerator_close_async (GFileEnumerator *enumerator, int io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
a GFileEnumerator. |
|
the io priority of the request. the io priority of the request |
|
optional GCancellable object, NULL to ignore.
|
|
callback to call when the request is satisfied |
|
the user_data to pass to callback function |
gboolean g_file_enumerator_close_finish (GFileEnumerator *enumerator, GAsyncResult *result, GError **error);
|
a GFileEnumerator. |
|
a GAsyncResult. |
|
a GError location to store the error occuring, or NULL to
ignore.
Returns: TRUE if the close operation has finished successfully.
|
Returns : |
gboolean g_file_enumerator_is_closed (GFileEnumerator *enumerator);
|
a GFileEnumerator. |
Returns : |
TRUE if the enumerator is closed.
|
gboolean g_file_enumerator_has_pending (GFileEnumerator *enumerator);
|
a GFileEnumerator. |
Returns : |
TRUE if the enumerator has pending operations.
|
void g_file_enumerator_set_pending (GFileEnumerator *enumerator, gboolean pending);
|
a GFileEnumerator. |
|
a boolean value. |