### Struct

# GLib Dir

since: 2.0

#### Description

    struct GDir {
      /* No available fields */
    }

An opaque structure representing an opened directory.

Available since: 2.0

#### Constructors

###### g_dir_open

Opens a directory for reading. The names of the files in the directory can then be retrieved using g_dir_read_name(). Note that the ordering is not defined.

since: 2.0

#### Functions

###### g_dir_make_tmp

Creates a subdirectory in the preferred directory for temporary files (as returned by g_get_tmp_dir()).

since: 2.30

#### Instance methods

###### g_dir_close

Closes the directory immediately and decrements the reference count.

since: 2.0

###### g_dir_read_name

Retrieves the name of another entry in the directory, or `NULL`. The order of entries returned from this function is not defined, and may vary by file system or other operating-system dependent factors.

since: 2.0

###### g_dir_ref

Increment the reference count of `dir`.

since: 2.80

###### g_dir_rewind

Resets the given directory. The next call to `g_dir_read_name()` will return the first entry again.

since: 2.0

###### g_dir_unref

Decrements the reference count of `dir`.

since: 2.80