GETCWD (The GNU Fortran Compiler)

### 8.130 `GETCWD` — Get current working directory ¶

Synopsis:

  `CALL GETCWD(C [, STATUS])`
  `STATUS = GETCWD(C)`

Description:

  Get current working directory.

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

Class:

  Subroutine, function

Arguments:

  C | The type shall be `CHARACTER` and of default kind.
  STATUS | (Optional) status flag. Returns 0 on success, a system specific and nonzero error code otherwise.

Example:

      PROGRAM test_getcwd
        CHARACTER(len=255) :: cwd
        CALL getcwd(cwd)
        WRITE(*,*) TRIM(cwd)
      END PROGRAM

Standard:

  GNU extension

See also:

  `CHDIR` — Change working directory