[<<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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson