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