Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>chdir() change current working directory</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 chdir()                 Change Current Working Directory

 #include   <dir.h>                      Required for declarations only

 int        chdir(pathname);
 const char *pathname;                   Path Name of new working directory

    chdir() changes the current working directory to the one specified by
    'pathname'.

       Returns:     0, if successful. If the specified path could not be
                    found, -1 is returned and 'errno' is set to ENOENT.

         Notes:     'pathname' must refer to an existing directory. When
                    referring to the root directory, use either the
                    forward slash ("/") or two backslashes ("\\").

                    'Pathname' can specify the current working directory.

                    'Pathname' can include a drive letter.

   -------------------------------- Example ---------------------------------

    Assuming the subdirectory "TEST" is defined in the root directory,
    the following statement changes the current working directory to
    '/TEST':

           #include <dir.h>

           main()
           {
               chdir("/TEST");
           }



See Also: mkdir() rmdir() system()

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