Loading...
Searching...
No Matches
path.f90 File Reference

Go to the source code of this file.

Data Types

interface  join
 Generic interface for joining two path components Supports all combinations of character and string arguments. More...
 

Functions/Subroutines

pure logical function is_absolute (filepath)
 Returns .true. if the path is absolute. On Unix a path is absolute when it starts with '/'. On Windows a path is absolute when it starts with a drive letter followed by ':\C:\', 'd:/temp').
 
pure logical function is_rooted (filepath)
 Returns .true. if the path is rooted (starts with a separator) or is absolute. A rooted path begins with the platform separator ('\' on Windows, '/' elsewhere) even if it is not a full absolute path (e.g. '/temp' on Linux).
 
pure character(:) function, allocatable filename (filepath, keepext)
 Extracts the filename part of a path. By default the extension is stripped. If keepext=.true. the full filename including extension is returned.
 
pure character(:) function, allocatable join_character_character (path1, path2)
 Joins two path components with the correct platform separator. Removes duplicate separators and trailing/leading whitespace.
 
pure character(:) function, allocatable join_character_string (path1, path2)
 Joins character path with string path component. Removes duplicate separators and trailing/leading whitespace.
 
pure character(:) function, allocatable join_string_character (path1, path2)
 Joins string path with character path component. Removes duplicate separators and trailing/leading whitespace.
 
pure character(:) function, allocatable join_string_string (path1, path2)
 Joins two string path components. Removes duplicate separators and trailing/leading whitespace.
 
pure character(:) function, allocatable dirpath (filepath)
 Returns the directory part of a path (everything before the last separator).
 
pure character(:) function, allocatable dirname (filepath)
 Returns the base name (filename) part of a path.
 
pure subroutine split_path (filepath, head, tail)
 Splits a path into head (directory) and tail (basename) components.
 
character(:) function, allocatable cwd ()
 Returns the current working directory as a deferred-length character string. Returns empty string on failure.
 
subroutine chdir (path, err)
 Changes the current working directory.