Syntax | #include <unistd.h> int chdir(const char *path); | |
Description |
path points to the pathname of a directory. | |
Return val. | 0 -1 | if successful. The specified directory becomes the current working directory. if an error occurs. |
Errors |
| |
| Search permission is denied for any component of the pathname. | |
Extension | ||
| path is an invalid address. A signal was caught during the execution of the An I/O error occurred while reading from or writing to the file system. Too many symbolic links were encountered in resolving path. (End) | |
| ||
The length of path exceeds | ||
| A component of path does not exist or is a null pathname. A component of the pathname is not a directory. | |
Notes | The effect of changing the working directory applies only for the duration of the current program (or current shell). If a new program or shell is started, the home directory is reset as the current working directory. In order to make a directory the current working directory, a process must have execute (search) permission for that directory. | |
See also |
|