---
name: "gfs_mkdir"
section: "3"
platform: "linux"
package: "libgfarm-dev"
version: "2.7.20+dfsg-1.2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gfs_mkdir"
---

# gfs\_mkdir(3)

create a directory

## NAME

gfs\_mkdir - create a directory

## SYNOPSIS

```
#include <gfarm/gfarm.h>
```

**gfarm\_error\_t gfs\_mkdir(const char \*** *gfarm\_url***, gfarm\_mode\_t** *mode***);**

## DESCRIPTION

**gfs\_mkdir()** attempts to create a directory named *gfarm\_url*.

*mode* speficies the permissions to use. It is modified by the process's *umask* in the usual way: the permissions of the created file are *(mode & ~umask)*.

## RETURN VALUES

**GFARM\_ERR\_NO\_ERROR**

The function terminated successfully.

**GFARM\_ERR\_NO\_MEMORY**

Insufficient memory was available.

**GFARM\_ERR\_ALREADY\_EXISTS**

*gfarm\_url* already exists (not necessarily as a directory). This includes the case where *gfarm\_url* is a symbolic link, dangling or not.

**GFARM\_ERR\_NO\_SUCH\_OBJECT**

The parent directory of *gfarm\_url* does not exist.

**GFARM\_ERR\_NOT\_A\_DIRECTORY**

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by **gfarm\_error\_string**(3).
