Blame docs/reference/gio/html/GFileEnumerator.html

Packit ae235b
Packit ae235b
<html>
Packit ae235b
<head>
Packit ae235b
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Packit ae235b
<title>GFileEnumerator: GIO Reference Manual</title>
Packit ae235b
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
Packit ae235b
<link rel="home" href="index.html" title="GIO Reference Manual">
Packit ae235b
<link rel="up" href="file_ops.html" title="File Operations">
Packit ae235b
<link rel="prev" href="GFileInfo.html" title="GFileInfo">
Packit ae235b
<link rel="next" href="gio-GIOError.html" title="GIOError">
Packit ae235b
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
Packit ae235b
<link rel="stylesheet" href="style.css" type="text/css">
Packit ae235b
</head>
Packit ae235b
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit ae235b
Packit ae235b
Packit ae235b
Top  | 
Packit ae235b
                  Description  | 
Packit ae235b
                  Object Hierarchy  | 
Packit ae235b
                  Properties
Packit ae235b
Packit ae235b
Home
Packit ae235b
Up
Packit ae235b
Prev
Packit ae235b
Next
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

GFileEnumerator

Packit ae235b

GFileEnumerator — Enumerated Files Routines

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_iterate ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GFileInfo *
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_next_file ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_close ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_next_files_async ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GList *
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_next_files_finish ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_close_async ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_close_finish ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_is_closed ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_has_pending ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_set_pending ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GFile *
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_get_container ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GFile *
Packit ae235b
Packit ae235b
Packit ae235b
g_file_enumerator_get_child ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Properties

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GFile *
Packit ae235b
container
Packit ae235b
Write / Construct Only
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
 
Packit ae235b
GFileEnumerator
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Object Hierarchy

Packit ae235b
    GObject
Packit ae235b
    ╰── GFileEnumerator
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Includes

Packit ae235b
#include <gio/gio.h>
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Description

Packit ae235b

GFileEnumerator allows you to operate on a set of GFiles,

Packit ae235b
returning a GFileInfo structure for each file enumerated (e.g. 
Packit ae235b
g_file_enumerate_children() will return a GFileEnumerator for each 
Packit ae235b
of the children within a directory).

Packit ae235b

To get the next file's information from a GFileEnumerator, use

Packit ae235b
g_file_enumerator_next_file() or its asynchronous version, 
Packit ae235b
g_file_enumerator_next_files_async(). Note that the asynchronous 
Packit ae235b
version will return a list of GFileInfos, whereas the 
Packit ae235b
synchronous will only return the next file in the enumerator.

Packit ae235b

The ordering of returned files is unspecified for non-Unix

Packit ae235b
platforms; for more information, see g_dir_read_name().  On Unix,
Packit ae235b
when operating on local files, returned files will be sorted by
Packit ae235b
inode number.  Effectively you can assume that the ordering of
Packit ae235b
returned files will be stable between successive calls (and
Packit ae235b
applications) assuming the directory is unchanged.

Packit ae235b

If your application needs a specific ordering, such as by name or

Packit ae235b
modification time, you will have to implement that in your
Packit ae235b
application code.

Packit ae235b

To close a GFileEnumerator, use g_file_enumerator_close(), or

Packit ae235b
its asynchronous version, g_file_enumerator_close_async(). Once 
Packit ae235b
a GFileEnumerator is closed, no further actions may be performed 
Packit ae235b
on it, and it should be freed with g_object_unref().

Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b

g_file_enumerator_iterate ()

Packit ae235b
gboolean
Packit ae235b
g_file_enumerator_iterate (GFileEnumerator *direnum,
Packit ae235b
                           GFileInfo **out_info,
Packit ae235b
                           GFile **out_child,
Packit ae235b
                           GCancellable *cancellable,
Packit ae235b
                           GError **error);
Packit ae235b

This is a version of g_file_enumerator_next_file() that's easier to

Packit ae235b
use correctly from C programs.  With g_file_enumerator_next_file(),
Packit ae235b
the gboolean return value signifies "end of iteration or error", which
Packit ae235b
requires allocation of a temporary GError.

Packit ae235b

In contrast, with this function, a FALSE return from

Packit ae235b
g_file_enumerator_iterate() *always* means
Packit ae235b
"error".  End of iteration is signaled by out_info
Packit ae235b
 or out_child
Packit ae235b
 being NULL.

Packit ae235b

Another crucial difference is that the references for out_info

Packit ae235b
 and
Packit ae235b
out_child
Packit ae235b
 are owned by direnum
Packit ae235b
 (they are cached as hidden
Packit ae235b
properties).  You must not unref them in your own code.  This makes
Packit ae235b
memory management significantly easier for C code in combination
Packit ae235b
with loops.

Packit ae235b

Finally, this function optionally allows retrieving a GFile as

Packit ae235b
well.

Packit ae235b

You must specify at least one of out_info

Packit ae235b
 or out_child
Packit ae235b
.

Packit ae235b

The code pattern for correctly using g_file_enumerator_iterate() from C

Packit ae235b
is:

Packit ae235b
Packit ae235b
  
Packit ae235b
    
Packit ae235b
      
Packit ae235b
        
1
Packit ae235b
2
Packit ae235b
3
Packit ae235b
4
Packit ae235b
5
Packit ae235b
6
Packit ae235b
7
Packit ae235b
8
Packit ae235b
9
Packit ae235b
10
Packit ae235b
11
Packit ae235b
12
Packit ae235b
13
Packit ae235b
        
direnum = g_file_enumerate_children (file, ...);
Packit ae235b
while (TRUE)
Packit ae235b
  {
Packit ae235b
    GFileInfo *info;
Packit ae235b
    if (!g_file_enumerator_iterate (direnum, &info, NULL, cancellable, error))
Packit ae235b
      goto out;
Packit ae235b
    if (!info)
Packit ae235b
      break;
Packit ae235b
    ... do stuff with "info"; do not unref it! ...
Packit ae235b
  }
Packit ae235b
Packit ae235b
out:
Packit ae235b
  g_object_unref (direnum); // Note: frees the last @info
Packit ae235b
      
Packit ae235b
    
Packit ae235b
  
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

direnum

Packit ae235b

an open GFileEnumerator

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

out_info

Packit ae235b

Output location for the next GFileInfo, or NULL.

Packit ae235b
[out][transfer none][optional]
Packit ae235b
Packit ae235b
Packit ae235b

out_child

Packit ae235b

Output location for the next GFile, or NULL.

Packit ae235b
[out][transfer none][optional]
Packit ae235b
Packit ae235b
Packit ae235b

cancellable

Packit ae235b

a GCancellable

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

error

Packit ae235b

a GError

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Since: 2.44

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_next_file ()

Packit ae235b
GFileInfo *
Packit ae235b
g_file_enumerator_next_file (GFileEnumerator *enumerator,
Packit ae235b
                             GCancellable *cancellable,
Packit ae235b
                             GError **error);
Packit ae235b

Returns information for the next file in the enumerated object.

Packit ae235b
Will block until the information is available. The GFileInfo 
Packit ae235b
returned from this function will contain attributes that match the 
Packit ae235b
attribute string that was passed when the GFileEnumerator was created.

Packit ae235b

See the documentation of GFileEnumerator for information about the

Packit ae235b
order of returned files.

Packit ae235b

On error, returns NULL and sets error

Packit ae235b
 to the error. If the
Packit ae235b
enumerator is at the end, NULL will be returned and error
Packit ae235b
 will
Packit ae235b
be unset.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

cancellable

Packit ae235b

optional GCancellable object, NULL to ignore.

Packit ae235b
[nullable]
Packit ae235b
Packit ae235b
Packit ae235b

error

Packit ae235b

location to store the error occurring, or NULL to ignore

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

A GFileInfo or NULL on error

Packit ae235b
or end of enumerator.  Free the returned object with
Packit ae235b
g_object_unref() when no longer needed. 

Packit ae235b

[nullable][transfer full]

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_close ()

Packit ae235b
gboolean
Packit ae235b
g_file_enumerator_close (GFileEnumerator *enumerator,
Packit ae235b
                         GCancellable *cancellable,
Packit ae235b
                         GError **error);
Packit ae235b

Releases all resources used by this enumerator, making the

Packit ae235b
enumerator return G_IO_ERROR_CLOSED on all calls.

Packit ae235b

This will be automatically called when the last reference

Packit ae235b
is dropped, but you might want to call this function to make 
Packit ae235b
sure resources are released as early as possible.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

cancellable

Packit ae235b

optional GCancellable object, NULL to ignore.

Packit ae235b
[nullable]
Packit ae235b
Packit ae235b
Packit ae235b

error

Packit ae235b

location to store the error occurring, or NULL to ignore

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

TRUE on success or FALSE on error.

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_next_files_async ()

Packit ae235b
void
Packit ae235b
g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
Packit ae235b
                                    int num_files,
Packit ae235b
                                    int io_priority,
Packit ae235b
                                    GCancellable *cancellable,
Packit ae235b
                                    GAsyncReadyCallback callback,
Packit ae235b
                                    gpointer user_data);
Packit ae235b

Request information for a number of files from the enumerator asynchronously.

Packit ae235b
When all i/o for the operation is finished the callback
Packit ae235b
 will be called with
Packit ae235b
the requested information. 

Packit ae235b

See the documentation of GFileEnumerator for information about the

Packit ae235b
order of returned files.

Packit ae235b

The callback can be called with less than num_files

Packit ae235b
 files in case of error
Packit ae235b
or at the end of the enumerator. In case of a partial error the callback will
Packit ae235b
be called with any succeeding items and no error, and on the next request the
Packit ae235b
error will be reported. If a request is cancelled the callback will be called
Packit ae235b
with G_IO_ERROR_CANCELLED.

Packit ae235b

During an async request no other sync and async calls are allowed, and will

Packit ae235b
result in G_IO_ERROR_PENDING errors. 

Packit ae235b

Any outstanding i/o request with higher priority (lower numerical value) will

Packit ae235b
be executed before an outstanding request with lower priority. Default
Packit ae235b
priority is G_PRIORITY_DEFAULT.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

num_files

Packit ae235b

the number of file info objects to request

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

io_priority

Packit ae235b

the I/O priority of the request

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

cancellable

Packit ae235b

optional GCancellable object, NULL to ignore.

Packit ae235b
[nullable]
Packit ae235b
Packit ae235b
Packit ae235b

callback

Packit ae235b

a GAsyncReadyCallback to call when the request is satisfied.

Packit ae235b
[scope async]
Packit ae235b
Packit ae235b
Packit ae235b

user_data

Packit ae235b

the data to pass to callback function.

Packit ae235b
[closure]
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_next_files_finish ()

Packit ae235b
GList *
Packit ae235b
g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
Packit ae235b
                                     GAsyncResult *result,
Packit ae235b
                                     GError **error);
Packit ae235b

Finishes the asynchronous operation started with g_file_enumerator_next_files_async().

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

result

Packit ae235b

a GAsyncResult.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

error

Packit ae235b

a GError location to store the error occurring, or NULL to

Packit ae235b
ignore.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

a GList of GFileInfos. You must free the list with

Packit ae235b
g_list_free() and unref the infos with g_object_unref() when you're
Packit ae235b
done with them. 

Packit ae235b

[transfer full][element-type Gio.FileInfo]

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_close_async ()

Packit ae235b
void
Packit ae235b
g_file_enumerator_close_async (GFileEnumerator *enumerator,
Packit ae235b
                               int io_priority,
Packit ae235b
                               GCancellable *cancellable,
Packit ae235b
                               GAsyncReadyCallback callback,
Packit ae235b
                               gpointer user_data);
Packit ae235b

Asynchronously closes the file enumerator.

Packit ae235b

If cancellable

Packit ae235b
 is not NULL, then the operation can be cancelled by
Packit ae235b
triggering the cancellable object from another thread. If the operation
Packit ae235b
was cancelled, the error G_IO_ERROR_CANCELLED will be returned in 
Packit ae235b
g_file_enumerator_close_finish().

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

io_priority

Packit ae235b

the I/O priority of the request

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

cancellable

Packit ae235b

optional GCancellable object, NULL to ignore.

Packit ae235b
[nullable]
Packit ae235b
Packit ae235b
Packit ae235b

callback

Packit ae235b

a GAsyncReadyCallback to call when the request is satisfied.

Packit ae235b
[scope async]
Packit ae235b
Packit ae235b
Packit ae235b

user_data

Packit ae235b

the data to pass to callback function.

Packit ae235b
[closure]
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_close_finish ()

Packit ae235b
gboolean
Packit ae235b
g_file_enumerator_close_finish (GFileEnumerator *enumerator,
Packit ae235b
                                GAsyncResult *result,
Packit ae235b
                                GError **error);
Packit ae235b

Finishes closing a file enumerator, started from g_file_enumerator_close_async().

Packit ae235b

If the file enumerator was already closed when g_file_enumerator_close_async()

Packit ae235b
was called, then this function will report G_IO_ERROR_CLOSED in error
Packit ae235b
, and 
Packit ae235b
return FALSE. If the file enumerator had pending operation when the close 
Packit ae235b
operation was started, then this function will report G_IO_ERROR_PENDING, and
Packit ae235b
return FALSE.  If cancellable
Packit ae235b
 was not NULL, then the operation may have been 
Packit ae235b
cancelled by triggering the cancellable object from another thread. If the operation
Packit ae235b
was cancelled, the error G_IO_ERROR_CANCELLED will be set, and FALSE will be 
Packit ae235b
returned.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

result

Packit ae235b

a GAsyncResult.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

error

Packit ae235b

a GError location to store the error occurring, or NULL to

Packit ae235b
ignore.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

TRUE if the close operation has finished successfully.

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_is_closed ()

Packit ae235b
gboolean
Packit ae235b
g_file_enumerator_is_closed (GFileEnumerator *enumerator);
Packit ae235b

Checks if the file enumerator has been closed.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

TRUE if the enumerator

Packit ae235b
is closed.

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_has_pending ()

Packit ae235b
gboolean
Packit ae235b
g_file_enumerator_has_pending (GFileEnumerator *enumerator);
Packit ae235b

Checks if the file enumerator has pending operations.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

TRUE if the enumerator

Packit ae235b
has pending operations.

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_set_pending ()

Packit ae235b
void
Packit ae235b
g_file_enumerator_set_pending (GFileEnumerator *enumerator,
Packit ae235b
                               gboolean pending);
Packit ae235b

Sets the file enumerator as having pending operations.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

pending

Packit ae235b

a boolean value.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_get_container ()

Packit ae235b
GFile *
Packit ae235b
g_file_enumerator_get_container (GFileEnumerator *enumerator);
Packit ae235b

Get the GFile container which is being enumerated.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

the GFile which is being enumerated.

Packit ae235b

[transfer none]

Packit ae235b
Packit ae235b

Since: 2.18

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_file_enumerator_get_child ()

Packit ae235b
GFile *
Packit ae235b
g_file_enumerator_get_child (GFileEnumerator *enumerator,
Packit ae235b
                             GFileInfo *info);
Packit ae235b

Return a new GFile which refers to the file named by info

Packit ae235b
 in the source
Packit ae235b
directory of enumerator
Packit ae235b
.  This function is primarily intended to be used
Packit ae235b
inside loops with g_file_enumerator_next_file().

Packit ae235b

This is a convenience method that's equivalent to:

Packit ae235b
Packit ae235b
  
Packit ae235b
    
Packit ae235b
      
Packit ae235b
        
1
Packit ae235b
2
Packit ae235b
3
Packit ae235b
        
gchar *name = g_file_info_get_name (info);
Packit ae235b
GFile *child = g_file_get_child (g_file_enumerator_get_container (enumr),
Packit ae235b
                                 name);
Packit ae235b
      
Packit ae235b
    
Packit ae235b
  
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

enumerator

Packit ae235b

a GFileEnumerator

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

info

Packit ae235b

a GFileInfo gotten from g_file_enumerator_next_file()

Packit ae235b
or the async equivalents.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

a GFile for the GFileInfo passed it.

Packit ae235b

[transfer full]

Packit ae235b
Packit ae235b

Since: 2.36

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b

GFileEnumerator

Packit ae235b
typedef struct _GFileEnumerator GFileEnumerator;
Packit ae235b

A per matched file iterator.

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Property Details

Packit ae235b
Packit ae235b

The “container” property

Packit ae235b
  “container”                GFile *
Packit ae235b

The container that is being enumerated.

Packit ae235b

Flags: Write / Construct Only

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Generated by GTK-Doc V1.27
Packit ae235b
</body>
Packit ae235b
</html>