mkdir_recursive.h File Reference

Create a new directory recursively. More...

`#include "compat-at.h"`
`#include <fcntl.h>`
`#include <sys/stat.h>`

Go to the source code of this file.

## Functions

int | mkdirat_recursive (int fd, const char *path, mode_t mode)
| Create a new directory recursively.
int | mkdir_recursive (const char *path, mode_t mode)
| Create a new directory recursively.
int | mkdirat_recursive_parents (int fd, const char *path, mode_t mode)
| Create needed parent directories of a file or directory.
int | mkdir_recursive_parents (const char *path, mode_t mode)
| Create needed parent directories of a file or directory.

## Detailed Description

Create a new directory recursively.

## Function Documentation

## mkdirat_recursive()

int mkdirat_recursive | ( | int | fd,
|  | const char * | path,
|  | mode_t | mode )

Create a new directory recursively.

Parameters

  fd | The directory path is relative to.
  path | The full path of a directory. It is not necessary for all components of the path to exist.
  mode | The desired unix mode bits of the directory and parents.

Returns
  -1 on failure, 0 on success.

## mkdir_recursive()

int mkdir_recursive | ( | const char * | path,
|  | mode_t | mode )

Create a new directory recursively.

Parameters

  path | The full path of a directory. It is not necessary for all components of the path to exist.
  mode | The desired unix mode bits of the directory and parents.

Returns
  -1 on failure, 0 on success.

## mkdirat_recursive_parents()

int mkdirat_recursive_parents | ( | int | fd,
|  | const char * | path,
|  | mode_t | mode )

Create needed parent directories of a file or directory.

Parameters

  fd | The directory path is relative to.
  path | The full path of a file or directory.
  mode | The desired unix mode bits of the parent directories.

Returns
  -1 on failure, 0 on success.

## mkdir_recursive_parents()

int mkdir_recursive_parents | ( | const char * | path,
|  | mode_t | mode )

Create needed parent directories of a file or directory.

Parameters

  path | The full path of a file or directory.
  mode | The desired unix mode bits of the parent directories.

Returns
  -1 on failure, 0 on success.