COHERENT manpages

This page displays the COHERENT manpage for chdir() [Change working directory].

List of available manpages
Index


chdir() -- System Call (libc)

Change working directory
#include <unistd.h>
chdir(directory) char *directory;

The working directory (or current directory)  is the  directory from  which
the search for  a file name begins if a  path name does not begin with `/'.
By convention, the working directory has the name `.'.  chdir() changes the
working directory to the directory  pointed to by directory. This change is
in effect until the program exits or calls chdir() again.

See Also

cd,
chmod(),
chroot(),
directory,
libc,
unistd.h
POSIX Standard, §5.2.1

Diagnostics

chdir() returns  zero if successful.   It returns -1 if  an error occurred,
e.g.,  that  directory does  not  exist,  is not  a  directory,  or is  not
searchable.