Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- 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   <direct.h>                   Required for declarations only

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

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


    Returns:    Zero if the directory is successfully changed; or -1, if
                the specified path could not be found, in which case
                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.

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

    The following statement changes the current working directory to
    '/TEST':

            #include <direct.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