fchdir()

change working directory based on file descriptor 

Function


SYNOPSIS

#include <unistd.h>

int fchdir(int fildes);


DESCRIPTION

The fchdir() function causes the directory to which fildes refers to become the current working directory. The current directory is the beginning point for file searches when path names are not absolute. If the fchdir() function fails, the current working directory remains unchanged.


PARAMETERS

fildes 

Is a file descriptor for a directory.


RETURN VALUES

If successful, fchdir() returns zero. On failure, it returns -1 and sets errno to one of the following values:

EACCES 

Search permission is denied for the directory referenced by fildes.

EBADF 

fildes is not a valid file descriptor.

EIO 

An I/O error occurred while reading from or writing to the file system.

ENOTDIR 

The open file descriptor fildes does not refer to a directory.


CONFORMANCE

POSIX.1 (1996), with exceptions.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

Windows supports multiple root directories, one for each drive, and also maintains a current working directory on each drive. The chdir() and fchdir() functions update the current working directory for the drive specified by the directory to which fildes points.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
chdir(), getcwd(), mkdir(), open()


PTC MKS Toolkit 10.3 Documentation Build 39.