Chapter Contents

Previous

Next
mkdir

mkdir



Create Directory

Portability: POSIX.1 conforming, UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLE
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

#include <sys/stat.h>

int mkdir(char *pathname, mode_t mode);


DESCRIPTION

mkdir creates a new USS directory and pathname is the directory name. mode is the set of file permission bits for the new directory. The owner ID of pathname is set to the effective user ID of the process. The group ID of pathname is set to the owning directory's group ID.

The pathname must specify an USS HFS filename. For programs not compiled with the posix option, a style prefix may be required. For more information on specifying USS filenames, see Low-level and Standard I/O.


RETURN VALUE

mkdir returns 0 if it is successful and -1 if it is not successful; it does not create a new directory.


EXAMPLE

The example for rewinddir also illustrates the use of mkdir .


RELATED FUNCTIONS

creat , rmdir , umask


SEE ALSO


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.