Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fchdir.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fchdir.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fchdir.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fchdir.html on line 8

fchdir()

Change the working directory

Synopsis:

#include <unistd.h>

int fchdir(int fd);

Arguments:

var
A file descriptor for the directory that you want to become the current working directory.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The fchdir() function is similar to chdir(), except that you use a file descriptor to specify the directory that you want to become the new current working directory. You can obtain a file descriptor for a directory by calling open(), provided that the file status flags and access modes don't contain O_WRONLY or O_RDWR.

Returns:

0, or -1 if an error occurred (errno is set). If the function fails, the current working directory isn't changed.

Errors:

EACCES
Search permission is denied for the directory referenced by fd.
EBADF
The fd argument isn't an open file descriptor.
ENOTDIR
The open file descriptor fd doesn't refer to a directory.
EINTR
A signal was caught during the execution of fchdir().
EIO
An I/O error occurred while reading from or writing to the filesystem.

Classification:

POSIX 1003.1 XSI

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

chdir(), errno, getcwd(), mkdir(), rmdir()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/f/fchdir.html on line 151

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/f/fchdir.html on line 151