NAME

mkdir - make a directory
rmdir - remove a directory

SYNOPSIS

#include <sys/types.h>
#include <unistd.h>

int mkdir(const char *path, mode_t mode );
int rmdir(const char *path, mode_t mode );

DESCRIPTION

mkdir() makes a directory at the specified path. rmdir removes path. The path must include all device information. path is then the complete path to the directory. The file permission bits of the new directory shall be initialized from mode. These file permission bits of the mode argument shall be limited to the subset of allowable mode bits for the server. The mode bits for servers are as follow:

Fsys
The mode bits are confined to user mode setting for read, write and execute. This is true for all media types.
NFS
The NFS server offers a full set of mode bits provided that the full set is setup within the NFS environment.

RETURNS

On success, mkdir() and rmdir() shall return 0. Otherwise, -1 shall be returned, no directory shall be created or removed and errno shall be set to indicate the error.

ERRORS

This function is a member of Unison's IOLIB family of functions. IOLIB is implemented as a message passing and generalized interface layer. Each Unison I/O server is responsible for its own error reporting.

For an exact list of error codes returned by a particular server, refer to that server's documentation in the Unison Programmer's Guide for each specific platform.

Servers may implement these errors codes in response to this function.

mkdir() and rmdir() fail and the file system remains unchanged if one or more of the following are true:

EACCES
path search permissions are not correct.
EEXIST
The file exists already.
ENAMETOOLONG
The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
ENOENT
A component of the path prefix specified by path does not name an existing directory or path is an empty string.
ENOSPC
The file system does not contain enough space to hold the contents of the new directory or to extend the parent directory of the new directory.
ENOTDIR
A component of the path which is prefixed is not a directory.
EROFS
Read only file system access error.

SEE ALSO

open(), read(), write()



< Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc. 1987-2011 >