◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back► ─────Run-Time Library─────────────────────────────────────────────────────── The _chdir function changes the current working directory to the directory specified by <dirname>. The <dirname> argument must refer to an existing directory. This function can change the current working directory on any drive; it cannot change the default drive itself. For example, if A: is the default drive and \BIN is the current working directory, the following call changes the current working directory for drive C: _chdir("c:\\temp"); Note that you must place two backslashes (\\) in a C string in order to represent a single backslash (\). The backslash is the escape character for C strings and therefore requires special handling. This function call has no apparent immediate effect. However, when the _chdrive function is called to change the default drive to C:, the current working directory becomes C:\TEMP. With DOS, the new directory set by the program becomes the new current working directory. Return Value The _chdir function returns a value of 0 if the working directory is successfully changed. A return value of -1 indicates an error, in which case errno is set to ENOENT, indicating that the specified path name could not be found. -♦-