INtime SDK Help
chdir, _th_chdir

Changes the current working directory.

#include <unistd.h>

chdir (const char *path)

_th_chdir (const char *path);


The path argument points to the pathname of a directory. chdir causes the named directory to become the current working directory, that is, the starting point for path searches of pathnames not beginning with a slash, '/' or '\' or a drive specification (A-Z:).

_th_chdir is the thread specific version of chdir(). Chdir()controls the current directory of the process. Once _th_chdir has been called, path becomes the current directory for the calling thread. To revert the thread to use the current directory of the process, pass a null string "" as path.

Return Values

0 (zero)
Failure. An invalid descriptor sets errno to this value:
ENOENT No current directory defined.
ENOTDIR A component of the path prefix is not a directory.
ENOENT Path is NULL or the named directory does not exist.
ERANGE Directory path is too long.
ENOMEM Out of memory constructing path.


Versions Defined in Include Link to
INtime 3.13 intime/rt/include/direct.h rt.h clib.lib
See Also