MKDIR(DOS) XENIX System V MKDIR(DOS)
Name
mkdir - Creates a new directory.
Syntax
#include <direct.h>
int mkdir (pathname);
char *pathname;
Description
The mkdir function creates a new directory with the
specified pathname. Only one directory can be created at a
time, so only the last component of pathname can name a new
directory.
Return Value
mkdir returns the value 0 if the new directory was created.
A return value of -1 indicates an error, and errno is set to
one of the following values:
Value Meaning
EACCES Directory not created: the given
name is the name of an existing
file, directory, or device.
ENOENT Pathname not found.
See Also
chdir(S), rmdir(DOS)
Page 1 (printed 8/7/87)
MKDIR(DOS) XENIX System V MKDIR(DOS)
Example
#include <direct.h>
int result;
/* The following two statements create two new directories:
** one at the root on drive b:, and one in the "tmp" **
subdirectory of the current working directory. */
result = mkdir ("b:/tmp"); /* "b:\\tmp" could also
. ** be used
. */
. result = mkdir ("tmp/sub"); /* "tmp\\sub" could
also **
be used
*/
Notes
This call must be compiled with the -dos flag.
Page 2 (printed 8/7/87)