CHDIR(3f)

DESCRIPTION
Change current working directory to a specified path.

This intrinsic is provided in both subroutine and function forms; however, only one form can be used in any given program unit.

STANDARD
GNU extension

CLASS
Subroutine, function

SYNTAX

CALL CHDIR(NAME [, STATUS]) STATUS = CHDIR(NAME)

ARGUMENTS

NAME The type shall be CHARACTER of default kind and shall specify a valid path within the file system. STATUS (Optional) INTEGER status flag of the default kind. Returns 0 on success, and a system specific and nonzero error code otherwise.

EXAMPLE
          PROGRAM test_chdir
            CHARACTER(len=255) :: path
            CALL getcwd(path)
            WRITE(*,*) TRIM(path)
            CALL chdir("/tmp")
            CALL getcwd(path)
            WRITE(*,*) TRIM(path)
          END PROGRAM

SEE ALSO
GETCWD

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).