Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 9/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

GETCWD

Portability Function: Returns the path of the current working directory.

Module

USE IFPORT

result = GETCWD (dirname)

dirname

(Output) Character *(*). Name of the current working directory path, including drive letter.

Results

The result type is INTEGER(4). The result is zero if successful; otherwise, an error code.

Example
    USE IFPORT
    character*30 dirname
!   variable dirname must be long enough to hold entire string
    integer(4) istat
    ISTAT = GETCWD (dirname)
    IF (ISTAT == 0) write *, 'Current directory is ',dirname

See Also