*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->HP-UX 11i man pages -> fchdir (2)              
Title
Content
Arch
Section
 

Contents


 chdir(2)                                                           chdir(2)




 NAME    [Toc]    [Back]
      chdir, fchdir - change working directory

 SYNOPSIS    [Toc]    [Back]
      #include <unistd.h>

      int chdir(const char *path);

      int fchdir(int fildes);

 DESCRIPTION    [Toc]    [Back]
      chdir() and fchdir() cause a directory pointed to by path or fildes to
      become the current working directory, the starting point for path
      searches of path names not beginning with /.  path points to the path
      name of a directory.  fildes is an open file descriptor of a
      directory.

      For a directory to become the current working directory, a process
      must have execute (search) access to the directory.

 RETURN VALUE    [Toc]    [Back]
      Upon successful completion, a value of 0 is returned.  Otherwise, a
      value of -1 is returned and errno is set to indicate the error.

 ERRORS    [Toc]    [Back]
      chdir() fails and the current working directory remains unchanged if
      one or more of the following are true:

      [ENOTDIR]                A component of the path name is not a
                               directory.

      [ENOENT]                 The named directory does not exist.

      [EACCES]                 Search permission is denied for any component
                               of the path name.

      [EFAULT]                 path points outside the allocated address
                               space of the process.  The reliable detection
                               of this error is implementation dependent.

      [ENOENT]                 path is null.

      [ENAMETOOLONG]           The length of the specified path name exceeds
                               PATH_MAX bytes, or the length of a component
                               of the path name exceeds NAME_MAX bytes while
                               _POSIX_NO_TRUNC is in effect.

      [ELOOP]                  Too many symbolic links were encountered in
                               translating the path name.





 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003






 chdir(2)                                                           chdir(2)




      fchdir() fails and the current working directory remains unchanged if
      one or more of the following are true:

      [EACCES]                 Search permission is denied for fildes.

      [EBADF]                  fildes is not an open file descriptor.

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

 AUTHOR    [Toc]    [Back]
      chdir() and fchdir() were developed by AT&T Bell Laboratories and HP.

 SEE ALSO    [Toc]    [Back]
      cd(1), chroot(2).

 STANDARDS CONFORMANCE    [Toc]    [Back]
      chdir(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1


 Hewlett-Packard Company            - 2 -   HP-UX 11i Version 2: August 2003
[ Back ]
      
      
 Similar pages
Name OS Title
chdir OpenBSD change current working directory
chdir NetBSD change current working directory
fchdir OpenBSD change current working directory
fchdir NetBSD change current working directory
chdir FreeBSD change current working directory
fchdir FreeBSD change current working directory
mcd Tru64 mtools utility to change or report the DOS working directory
pwd HP-UX working directory name
cd Tru64 Changes the current working directory
getcwd NetBSD get working directory pathname
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service