home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
LIBSRC.ZOO
/
libsrc
/
local
/
mkdir.c
< prev
next >
Wrap
Text File
|
1992-02-21
|
776b
|
47 lines
#define INCL_DOSFILEMGR
#define INCL_DOSERRORS
#include <os2.h>
#include <errno.h>
ULONG Dos32CreateDir() asm ("Dos32CreateDir");
int mkdir (const char *path, int mode)
{
ULONG rc;
rc = Dos32CreateDir ((PSZ)path, 0);
if (rc)
{
if (rc == ERROR_PATH_NOT_FOUND)
{
errno = ENOTDIR;
return (-1);
}
if (rc == ERROR_ACCESS_DENIED)
{
errno = EACCES;
return (-1);
}
if (rc == ERROR_INVALID_PARAMETER)
{
errno = EINVAL;
return (-1);
}
if (rc == ERROR_FILENAME_EXCED_RANGE)
{
errno = ENAMETOOLONG;
return (-1);
}
errno = EIO;
return (-1);
}
return (0);
}