Determines if a path is absolute or not. Returns True if path is absolute and False if path is relative.
l = is_path_absolute(fname)
Where:
fname
: Name of the path to be checked.It returns True if fname is an absolute path and false otherwise.
The following program checks the if some paths are absolute or not:
PROGRAM is_path_absoluteExample
USE FU_Files, ONLY: is_path_absolute
IMPLICIT NONE
CHARACTER(LEN=:), ALLOCATABLE :: path
path='file1'
WRITE(*,*) path, is_path_absolute(path)
path='./file1'
WRITE(*,*) path, is_path_absolute(path)
path='/tmp/file1'
WRITE(*,*) path, is_path_absolute(path)
END PROGRAM is_path_absoluteExample
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fname |
Path to a file. |
True if the path is absolute and false if the path is relative.