### Method

# GLib Dir read_name

#### Declaration

    const gchar*
    g_dir_read_name (
      GDir* dir
    )

#### Description

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.

`NULL` may also be returned in case of errors. On Unix, you can check `errno` to find out if `NULL` was returned because of an error.

On Unix, the ‘.’ and ‘..’ entries are omitted, and the returned name is in the on-disk encoding.

On Windows, as is true of all GLib functions which operate on filenames, the returned name is in UTF-8.

#### Return value

Type: `const gchar*`

The entry’s name or `NULL` if there are no more entries. The return value is owned by GLib and must not be modified or freed.

The returned data is owned by the instance.
The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.