### Function

# GLib mkdir

since: 2.6

#### Declaration [src]

    int
    g_mkdir (
      const gchar* filename,
      int mode
    )

#### Description [src]

A wrapper for the POSIX `mkdir()` function. The `mkdir()` function attempts to create a directory with the given name and permissions. The mode argument is ignored on Windows.

See your C library manual for more details about mkdir().

Available since: 2.6

#### Parameters

`filename`

  Type: `const gchar*`

  A pathname in the GLib file name encoding (UTF-8 on Windows)

  The data is owned by the caller of the function.
  The value is a file system path, using the OS encoding.

`mode`

  Type: `int`

  Permissions to use for the newly created directory.

#### Return value

Type: `int`

0 if the directory was successfully created, -1 if an error occurred.