Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - chdir http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   chdir

   Usage
   #include <direct.h>
   int chdir(char *path);

   Description
   chdir  is  a  system call that changes the current  directory  to  the
   directory  specified  in  the  path argument. path  must  be  a  valid
   directory. It is possible to specify a drive in the path argument,  in
   which  case  the current directory on that drive is changed,  but  the
   current drive is not changed.

   Example
   #include <direct.h>
   #include <stdio.h>
   char *path = "\\temp";
   main()
   {
   int result;
        result = chdir(path);
        if(result != 0)
             printf("Could not change to directory %s\n",path);
        else
             printf("Directory changed to %s\n",path);
   }

   Return Value
   Returns a 0 upon success otherwise a -1 and errno is set.


See Also: mkdir rmdir

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson