hi has anyone know detailed info on the mkdir function plus the open dir and how to use it ?

mkdir   Creates a directory.


 Syntax:
   int mkdir(const char *path);

 Prototype in:
 dir.h

 Remarks:
mkdir creates a new directory from the given
path name path.

 Return Value:
mkdir returns the value 0 if the new directory
was created.

On error, a value of -1 is returned, and the
global variable errno is set to one of the
following values:

   Setting ³ Description
  
   EACCES  ³ Permission denied
   ENOENT  ³ No such file or directory

 Portability:
mkdir is available on UNIX System V, though it
takes an additional file-mode parameter.

 See Also:
  chdir    getcurdir    getcwd    rmdir

 Example:
 #include <stdio.h>
 #include <conio.h>
 #include <process.h>
 #include <dir.h>

 int main(void)
 {
   int status;

    clrscr();
    status = mkdir("asdfjklm");
    (!status) ? (printf("Directory created\n")) :
                (printf("Unable to create directory\n"));

    getch();
    system("dir");
    getch();

    status = rmdir("asdfjklm");
    (!status) ? (printf("Directory deleted\n")) :
                (perror("Unable to delete directory"));

    return 0;
 }
This article has been dead for over six months. Start a new discussion instead.