newdir()

newdir()#

newdir() creates a new directory with the specified permissions, ensuring that the umask is set to zero for controlled permission handling.

Prototype

int newdir(
    const char *path,
    int         permission
);

Parameters

Key

Type

Description

path

const char *

The path of the directory to be created.

permission

int

The permission mode for the new directory.


Return Value

Returns 0 on success, or -1 if an error occurs.

Notes

This function ensures that the umask is cleared before creating the directory to allow precise permission control.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples