<refentry id="glib-File-Utilities">
<refmeta>
<refentrytitle>File Utilities</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GLIB Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>File Utilities</refname><refpurpose>various file-related functions.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;glib.h&gt;


enum        <link linkend="GFileError">GFileError</link>;
#define     <link linkend="G-FILE-ERROR-CAPS">G_FILE_ERROR</link>
enum        <link linkend="GFileTest">GFileTest</link>;
<link linkend="GFileError">GFileError</link>  <link linkend="g-file-error-from-errno">g_file_error_from_errno</link>         (<link linkend="gint">gint</link> err_no);
<link linkend="gboolean">gboolean</link>    <link linkend="g-file-get-contents">g_file_get_contents</link>             (const <link linkend="gchar">gchar</link> *filename,
                                             <link linkend="gchar">gchar</link> **contents,
                                             <link linkend="gsize">gsize</link> *length,
                                             <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>    <link linkend="g-file-test">g_file_test</link>                     (const <link linkend="gchar">gchar</link> *filename,
                                             <link linkend="GFileTest">GFileTest</link> test);
int         <link linkend="g-mkstemp">g_mkstemp</link>                       (char *tmpl);
int         <link linkend="g-file-open-tmp">g_file_open_tmp</link>                 (const char *tmpl,
                                             char **name_used,
                                             <link linkend="GError">GError</link> **error);

struct      <link linkend="GDir">GDir</link>;
<link linkend="GDir">GDir</link>*       <link linkend="g-dir-open">g_dir_open</link>                      (const <link linkend="gchar">gchar</link> *path,
                                             <link linkend="guint">guint</link> flags,
                                             <link linkend="GError">GError</link> **error);
G_CONST_RETURN <link linkend="gchar">gchar</link>* <link linkend="g-dir-read-name">g_dir_read_name</link>       (<link linkend="GDir">GDir</link> *dir);
void        <link linkend="g-dir-rewind">g_dir_rewind</link>                    (<link linkend="GDir">GDir</link> *dir);
void        <link linkend="g-dir-close">g_dir_close</link>                     (<link linkend="GDir">GDir</link> *dir);

</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="GFileError">enum GFileError</title>
<programlisting>typedef enum
{
  G_FILE_ERROR_EXIST,
  G_FILE_ERROR_ISDIR,
  G_FILE_ERROR_ACCES,
  G_FILE_ERROR_NAMETOOLONG,
  G_FILE_ERROR_NOENT,
  G_FILE_ERROR_NOTDIR,
  G_FILE_ERROR_NXIO,
  G_FILE_ERROR_NODEV,
  G_FILE_ERROR_ROFS,
  G_FILE_ERROR_TXTBSY,
  G_FILE_ERROR_FAULT,
  G_FILE_ERROR_LOOP,
  G_FILE_ERROR_NOSPC,
  G_FILE_ERROR_NOMEM,
  G_FILE_ERROR_MFILE,
  G_FILE_ERROR_NFILE,
  G_FILE_ERROR_BADF,
  G_FILE_ERROR_INVAL,
  G_FILE_ERROR_PIPE,
  G_FILE_ERROR_AGAIN,
  G_FILE_ERROR_INTR,
  G_FILE_ERROR_IO,
  G_FILE_ERROR_PERM,
  G_FILE_ERROR_FAILED
} GFileError;
</programlisting>
<para>
Values corresponding to <literal>errno</literal> codes returned from file operations
on UNIX. Unlike <literal>errno</literal> codes, <link linkend="GFileError">GFileError</link> values are available on 
all systems, even Windows. The exact meaning of each code depends on what
sort of file operation you were performing; the UNIX documentation
gives more details. The following error code descriptions come 
from the GNU C Library manual, and are under the copyright
of that manual.
</para>

<para>
It's not very portable to make detailed assumptions about exactly
which errors will be returned from a given operation. Some errors
don't occur on some systems, etc., sometimes there are subtle
differences in when a system will report a given error, etc.
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>G_FILE_ERROR_EXIST</literal></entry>
<entry>Operation not permitted; only the owner of the
     file (or other resource) or processes with special privileges can
     perform the operation.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_ISDIR</literal></entry>
<entry>File is a directory; you cannot open a directory
     for writing, or create or remove hard links to it.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_ACCES</literal></entry>
<entry>Permission denied; the file permissions do not
     allow the attempted operation.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NAMETOOLONG</literal></entry>
<entry>Filename too long.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NOENT</literal></entry>
<entry>No such file or directory.  This is a "file
     doesn't exist" error for ordinary files that are referenced in
     contexts where they are expected to already exist.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NOTDIR</literal></entry>
<entry>A file that isn't a directory was specified when
     a directory is required.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NXIO</literal></entry>
<entry>No such device or address.  The system tried to
     use the device represented by a file you specified, and it
     couldn't find the device.  This can mean that the device file was
     installed incorrectly, or that the physical device is missing or
     not correctly attached to the computer.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NODEV</literal></entry>
<entry>This file is of a type that doesn't support
     mapping.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_ROFS</literal></entry>
<entry>The directory containing the new link can't be
          modified because it's on a read-only file system.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_TXTBSY</literal></entry>
<entry>Text file busy.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_FAULT</literal></entry>
<entry>You passed in a pointer to bad memory.
  (GLib won't reliably return this, don't pass in pointers to bad
  memory.)
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_LOOP</literal></entry>
<entry>Too many levels of symbolic links were encountered
  in looking up a file name.  This often indicates a cycle of symbolic
  links.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NOSPC</literal></entry>
<entry>No space left on device; write operation on a
  file failed because the disk is full.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NOMEM</literal></entry>
<entry>No memory available.  The system cannot allocate
     more virtual memory because its capacity is full.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_MFILE</literal></entry>
<entry>The current process has too many files open and
     can't open any more.  Duplicate descriptors do count toward this
     limit.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_NFILE</literal></entry>
<entry>There are too many distinct file openings in the
     entire system.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_BADF</literal></entry>
<entry>Bad file descriptor; for example, I/O on a
     descriptor that has been closed or reading from a descriptor open
     only for writing (or vice versa).
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_INVAL</literal></entry>
<entry>Invalid argument.  This is used to indicate
     various kinds of problems with passing the wrong argument to a
     library function.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_PIPE</literal></entry>
<entry>Broken pipe; there is no process reading from the
     other end of a pipe.  Every library function that returns this
     error code also generates a `SIGPIPE' signal; this signal
     terminates the program if not handled or blocked.  Thus, your
     program will never actually see this code unless it has handled or
     blocked `SIGPIPE'.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_AGAIN</literal></entry>
<entry>Resource temporarily unavailable; the call might
     work if you try again later.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_INTR</literal></entry>
<entry>Interrupted function call; an asynchronous signal
     occurred and prevented completion of the call.  When this
     happens, you should try the call again.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_IO</literal></entry>
<entry>Input/output error; usually used for physical read
    or write errors. i.e. the disk or other physical device hardware
    is returning errors.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_PERM</literal></entry>
<entry>Operation not permitted; only the owner of the
     file (or other resource) or processes with special privileges can
     perform the operation.
</entry>
</row>
<row>
<entry><literal>G_FILE_ERROR_FAILED</literal></entry>
<entry>Does not correspond to a UNIX error code; this
  is the standard "failed for unspecified reason" error code present in 
  all <link linkend="GError">GError</link> error code enumerations. Returned if no specific
  code applies.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="G-FILE-ERROR-CAPS">G_FILE_ERROR</title>
<programlisting>#define G_FILE_ERROR g_file_error_quark ()
</programlisting>
<para>
Error domain for file operations. Errors in this domain will
be from the <link linkend="GFileError">GFileError</link> enumeration. See <link linkend="GError">GError</link> for information on 
error domains.
</para></refsect2>
<refsect2>
<title><anchor id="GFileTest">enum GFileTest</title>
<programlisting>typedef enum
{
  G_FILE_TEST_IS_REGULAR    = 1 &lt;&lt; 0,
  G_FILE_TEST_IS_SYMLINK    = 1 &lt;&lt; 1,
  G_FILE_TEST_IS_DIR        = 1 &lt;&lt; 2,
  G_FILE_TEST_IS_EXECUTABLE = 1 &lt;&lt; 3,
  G_FILE_TEST_EXISTS        = 1 &lt;&lt; 4
} GFileTest;
</programlisting>
<para>
A test to perform an a file using <link linkend="g-file-test">g_file_test</link>().
</para><informaltable pgwide="1" frame="none" role="enum">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><literal>G_FILE_TEST_IS_REGULAR</literal></entry>
<entry><literal>TRUE</literal> if the file is a regular file (not a symlink or directory)
</entry>
</row>
<row>
<entry><literal>G_FILE_TEST_IS_SYMLINK</literal></entry>
<entry><literal>TRUE</literal> if the file is a symlink.
</entry>
</row>
<row>
<entry><literal>G_FILE_TEST_IS_DIR</literal></entry>
<entry><literal>TRUE</literal> if the file is a directory.
</entry>
</row>
<row>
<entry><literal>G_FILE_TEST_IS_EXECUTABLE</literal></entry>
<entry><literal>TRUE</literal> if the file is executable.
</entry>
</row>
<row>
<entry><literal>G_FILE_TEST_EXISTS</literal></entry>
<entry><literal>TRUE</literal> if the file exists. It may or may not be a regular file.

</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-file-error-from-errno">g_file_error_from_errno ()</title>
<programlisting><link linkend="GFileError">GFileError</link>  g_file_error_from_errno         (<link linkend="gint">gint</link> err_no);</programlisting>
<para>
Gets a <link linkend="GFileError">GFileError</link> constant based on the passed-in <parameter>errno</parameter>.
For example, if you pass in <literal>EEXIST</literal> this function returns
<link linkend="G-FILE-ERROR-EXIST-CAPS">G_FILE_ERROR_EXIST</link>. Unlike <parameter>errno</parameter> values, you can portably
assume that all <link linkend="GFileError">GFileError</link> values will exist.
</para>
<para>
Normally a <link linkend="GFileError">GFileError</link> value goes into a <link linkend="GError">GError</link> returned
from a function that manipulates files. So you would use
<link linkend="g-file-error-from-errno">g_file_error_from_errno</link>() when constructing a <link linkend="GError">GError</link>.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>err_no</parameter>&nbsp;:</entry>
<entry> an "errno" value
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <link linkend="GFileError">GFileError</link> corresponding to the given <parameter>errno</parameter>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-file-get-contents">g_file_get_contents ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    g_file_get_contents             (const <link linkend="gchar">gchar</link> *filename,
                                             <link linkend="gchar">gchar</link> **contents,
                                             <link linkend="gsize">gsize</link> *length,
                                             <link linkend="GError">GError</link> **error);</programlisting>
<para>
Reads an entire file into allocated memory, with good error
checking. If <parameter>error</parameter> is set, <literal>FALSE</literal> is returned, and <parameter>contents</parameter> is set
to <literal>NULL</literal>. If <literal>TRUE</literal> is returned, <parameter>error</parameter> will not be set, and <parameter>contents</parameter>
will be set to the file contents.  The string stored in <parameter>contents</parameter>
will be nul-terminated, so for text files you can pass <literal>NULL</literal> for the
<parameter>length</parameter> argument.  The error domain is <link linkend="G-FILE-ERROR-CAPS">G_FILE_ERROR</link>. Possible
error codes are those in the <link linkend="GFileError">GFileError</link> enumeration.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> a file to read contents from
</entry></row>
<row><entry align="right"><parameter>contents</parameter>&nbsp;:</entry>
<entry> location to store an allocated string
</entry></row>
<row><entry align="right"><parameter>length</parameter>&nbsp;:</entry>
<entry> location to store length in bytes of the contents
</entry></row>
<row><entry align="right"><parameter>error</parameter>&nbsp;:</entry>
<entry> return location for a <link linkend="GError">GError</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> <literal>TRUE</literal> on success, <literal>FALSE</literal> if error is set
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-file-test">g_file_test ()</title>
<programlisting><link linkend="gboolean">gboolean</link>    g_file_test                     (const <link linkend="gchar">gchar</link> *filename,
                                             <link linkend="GFileTest">GFileTest</link> test);</programlisting>
<para>
Returns <literal>TRUE</literal> if any of the tests in the bitfield <parameter>test</parameter> are
<literal>TRUE</literal>. For example, <literal>(G_FILE_TEST_EXISTS | 
G_FILE_TEST_IS_DIR)</literal> will return <literal>TRUE</literal> if the file exists; 
the check whether it's a directory doesn't matter since the existence 
test is <literal>TRUE</literal>. With the current set of available tests, there's no point
passing in more than one test at a time.
</para>
<para>
Apart from <link linkend="G-FILE-TEST-IS-SYMLINK-CAPS">G_FILE_TEST_IS_SYMLINK</link> all tests follow symbolic links,
so for a symbolic link to a regular file <link linkend="g-file-test">g_file_test</link>() will return
<literal>TRUE</literal> for both <link linkend="G-FILE-TEST-IS-SYMLINK-CAPS">G_FILE_TEST_IS_SYMLINK</link> and <link linkend="G-FILE-TEST-IS-REGULAR-CAPS">G_FILE_TEST_IS_REGULAR</link>.
</para>
<para>
Note, that for a dangling symbolic link <link linkend="g-file-test">g_file_test</link>() will return
<literal>TRUE</literal> for <link linkend="G-FILE-TEST-IS-SYMLINK-CAPS">G_FILE_TEST_IS_SYMLINK</link> and <literal>FALSE</literal> for all other flags.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>filename</parameter>&nbsp;:</entry>
<entry> a filename to test
</entry></row>
<row><entry align="right"><parameter>test</parameter>&nbsp;:</entry>
<entry> bitfield of <link linkend="GFileTest">GFileTest</link> flags
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> whether a test was <literal>TRUE</literal>
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-mkstemp">g_mkstemp ()</title>
<programlisting>int         g_mkstemp                       (char *tmpl);</programlisting>
<para>
Opens a temporary file. See the <function><link linkend="mkstemp">mkstemp</link>()</function> documentation
on most UNIX-like systems. This is a portability wrapper, which simply calls 
<function><link linkend="mkstemp">mkstemp</link>()</function> on systems that have it, and implements 
it in GLib otherwise.
</para>
<para>
The parameter is a string that should match the rules for
<function><link linkend="mkstemp">mkstemp</link>()</function>, i.e. end in "XXXXXX". The X string will 
be modified to form the name of a file that didn't exist.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>tmpl</parameter>&nbsp;:</entry>
<entry> template filename
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> A file handle (as from <function><link linkend="open">open</link>()</function>) to the file
opened for reading and writing. The file is opened in binary mode
on platforms where there is a difference. The file handle should be
closed with <function><link linkend="close">close</link>()</function>. In case of errors, -1 is returned.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-file-open-tmp">g_file_open_tmp ()</title>
<programlisting>int         g_file_open_tmp                 (const char *tmpl,
                                             char **name_used,
                                             <link linkend="GError">GError</link> **error);</programlisting>
<para>
Opens a file for writing in the preferred directory for temporary
files (as returned by <link linkend="g-get-tmp-dir">g_get_tmp_dir</link>()). 
</para>
<para>
<parameter>tmpl</parameter> should be a string ending with six 'X' characters, as the
parameter to <link linkend="g-mkstemp">g_mkstemp</link>() (or <function><link linkend="mkstemp">mkstemp</link>()</function>). 
However, unlike these functions, the template should only be a 
basename, no directory components are allowed. If template is <literal>NULL</literal>, 
a default template is used.
</para>
<para>
Note that in contrast to <link linkend="g-mkstemp">g_mkstemp</link>() (and <function><link linkend="mkstemp">mkstemp</link>()</function>) 
<parameter>tmpl</parameter> is not modified, and might thus be a read-only literal string.
</para>
<para>
The actual name used is returned in <parameter>name_used</parameter> if non-<literal>NULL</literal>. This
string should be freed with <link linkend="g-free">g_free</link>() when not needed any longer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>tmpl</parameter>&nbsp;:</entry>
<entry> Template for file name, as in <link linkend="g-mkstemp">g_mkstemp</link>(), basename only
</entry></row>
<row><entry align="right"><parameter>name_used</parameter>&nbsp;:</entry>
<entry> location to store actual name used
</entry></row>
<row><entry align="right"><parameter>error</parameter>&nbsp;:</entry>
<entry> return location for a <link linkend="GError">GError</link>
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> A file handle (as from <function><link linkend="open">open</link>()</function>) to 
the file opened for reading and writing. The file is opened in binary 
mode on platforms where there is a difference. The file handle should be
closed with <function><link linkend="close">close</link>()</function>. In case of errors, -1 is returned 
and <parameter>error</parameter> will be set.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GDir">struct GDir</title>
<programlisting>struct GDir;</programlisting>
<para>
An opaque structure representing an opened directory.
</para></refsect2>
<refsect2>
<title><anchor id="g-dir-open">g_dir_open ()</title>
<programlisting><link linkend="GDir">GDir</link>*       g_dir_open                      (const <link linkend="gchar">gchar</link> *path,
                                             <link linkend="guint">guint</link> flags,
                                             <link linkend="GError">GError</link> **error);</programlisting>
<para>
Opens a directory for reading. The names of the files
in the directory can then be retrieved using
<link linkend="g-dir-get-name">g_dir_get_name</link>().</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>path</parameter>&nbsp;:</entry>
<entry> the path to the directory you are interested in
</entry></row>
<row><entry align="right"><parameter>flags</parameter>&nbsp;:</entry>
<entry> Currently must be set to 0. Reserved for future use.
</entry></row>
<row><entry align="right"><parameter>error</parameter>&nbsp;:</entry>
<entry> return location for a <link linkend="GError">GError</link>, or <literal>NULL</literal>.
        If non-<literal>NULL</literal>, an error will be set if and only if
        g_dir_open_fails.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> a newly allocated <link linkend="GDir">GDir</link> on success, <literal>NULL</literal> on failure.
  If non-<literal>NULL</literal>, you must free the result with <link linkend="g-dir-close">g_dir_close</link>()
  when you are finished with it.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-dir-read-name">g_dir_read_name ()</title>
<programlisting>G_CONST_RETURN <link linkend="gchar">gchar</link>* g_dir_read_name       (<link linkend="GDir">GDir</link> *dir);</programlisting>
<para>
Retrieves the name of the next entry in the directory.
The '.' and '..' entries are omitted.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>dir</parameter>&nbsp;:</entry>
<entry> a <link linkend="GDir">GDir</link>* created by <link linkend="g-dir-open">g_dir_open</link>()
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The entries name or <literal>NULL</literal> if there are no 
  more entries. The return value is owned by GLib and
  must not be modified or freed.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-dir-rewind">g_dir_rewind ()</title>
<programlisting>void        g_dir_rewind                    (<link linkend="GDir">GDir</link> *dir);</programlisting>
<para>
Resets the given directory. The next call to <link linkend="g-dir-read-name">g_dir_read_name</link>()
will return the first entry again.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>dir</parameter>&nbsp;:</entry>
<entry> a <link linkend="GDir">GDir</link>* created by <link linkend="g-dir-open">g_dir_open</link>()
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="g-dir-close">g_dir_close ()</title>
<programlisting>void        g_dir_close                     (<link linkend="GDir">GDir</link> *dir);</programlisting>
<para>
Closes the directory and deallocates all related resources.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>dir</parameter>&nbsp;:</entry>
<entry> a <link linkend="GDir">GDir</link>* created by <link linkend="g-dir-open">g_dir_open</link>()
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
