is_absolute Function

private pure function is_absolute(path)

True if path starts with / or \, or has a drive letter such as C:.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: path

the path to test

Return Value logical


Called by

proc~~is_absolute~~CalledByGraph proc~is_absolute is_absolute proc~absolute_path absolute_path proc~absolute_path->proc~is_absolute proc~directory_files directory_files proc~directory_files->proc~absolute_path proc~options_for options_for proc~options_for->proc~absolute_path proc~process_file process_file proc~process_file->proc~absolute_path proc~process_text process_text proc~process_file->proc~process_text proc~process_text->proc~options_for proc~run run proc~run->proc~directory_files proc~run->proc~process_file proc~process_stdin process_stdin proc~run->proc~process_stdin proc~process_stdin->proc~process_text

Source Code

pure logical function is_absolute(path)
    !! True if `path` starts with `/` or `\`, or has a drive letter such as `C:`.
    character(len=*), intent(in) :: path   !! the path to test
    is_absolute = .false.
    if (len(path) == 0) return
    is_absolute = path(1:1) == '/' .or. path(1:1) == '\'
    if (len(path) >= 2) is_absolute = is_absolute .or. path(2:2) == ':'
end function is_absolute