returns TRUE if directory exists
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | dir |
FUNCTION DirExists & ! (dir) & ! RESULT (exists) IMPLICIT NONE !Arguments with intent(in): CHARACTER (LEN = *), INTENT(IN) :: dir ! Local declarations: LOGICAL :: exists !------------end of declaration------------------------------------------------ !work around for cross compiler portability #ifdef __INTEL_COMPILER !DIRECTORY specification is available only in intel compiler INQUIRE(DIRECTORY = dir, EXIST = exists) #else !this solution does not work for intel compiler INQUIRE(FILE = dir // '/.', EXIST = exists) #endif RETURN END FUNCTION DirExists