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");
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster