header file: unistd.h
int chdir(const char *path);
int _chdir(const char *path);
This function changes the current working directory to the one
specified in the path argument.
Since this function has a one-to-one correspondence with the
_chdir function in Windows, there should not be any other changes
required other than renaming the function and including the header
file.
Example of Use in Windows
#include <direct.h>
int error;
error = chdir("/tmp"));
if (error)
printf("Current working directory is now /tmp");
else
printf("_chdir failed with error number %d", error);