version 0.6.0
File and directory management

Functions/Subroutines

logical function mod_file_manager::directory_exists (directory)
 Check if a directory exists. More...
 
logical function mod_file_manager::file_exists (filename)
 Check if a file exists. More...
 
character(len=:) function, allocatable mod_file_manager::get_file_path (filename)
 Extract the path of a given file. More...
 
character(len=:) function, allocatable mod_file_manager::get_file_name (path)
 Extract the filename of a given path. More...
 
subroutine mod_file_manager::create_directory (directory)
 Create a directory. More...
 
character(len=:) function, allocatable mod_file_manager::simplify_path (path)
 Simplify "//" in "/" in a path. More...
 
character(len=:) function, allocatable mod_file_manager::escape_path (path)
 Replace any forbidden character by its escaped form. More...
 
subroutine mod_file_manager::ensure_directory_exists (directory, use_barrier)
 If the given directory does not exist, create the directory. More...
 
character(len=:) function, allocatable mod_file_manager::read_environment_variable (env, is_fatal)
 Read an environment variable. More...
 
character(len=:) function, allocatable mod_file_manager::replace_tilde_with_home (path)
 Replace '~' in path by the content of the 'HOME' environment variable. More...
 
subroutine mod_file_manager::get_notus_path (path)
 Find the path of Notus executable. More...
 

Detailed Description

Function/Subroutine Documentation

◆ create_directory()

subroutine mod_file_manager::create_directory ( character(len=*), intent(in)  directory)
Attention
This routine contains platform-dependent code
Parameters
[in]directoryString containing the directory path.

◆ directory_exists()

logical function mod_file_manager::directory_exists ( character(len=*), intent(in)  directory)

Provide a compiler-independant way to check if a directory exists.

Parameters
[in]directoryString containing the directory path.

◆ ensure_directory_exists()

subroutine mod_file_manager::ensure_directory_exists ( character(len=*), intent(in)  directory,
logical, intent(in), optional  use_barrier 
)
Parameters
[in]directoryString containing the directory path.
[in]use_barrierOptional flag to use a mpi_barrier after creating the file (default: false)

◆ escape_path()

character(len=:) function, allocatable mod_file_manager::escape_path ( character(len=*), intent(in)  path)
Parameters
[in]pathString containing the path to escape.

◆ file_exists()

logical function mod_file_manager::file_exists ( character(len=*), intent(in)  filename)
Parameters
[in]filenameString containing the file name.

◆ get_file_name()

character(len=:) function, allocatable mod_file_manager::get_file_name ( character(len=*), intent(in)  path)
Parameters
[in]pathString containing the path and the file name.

◆ get_file_path()

character(len=:) function, allocatable mod_file_manager::get_file_path ( character(len=*), intent(in)  filename)
Parameters
[in]filenameString containing the file name.

◆ get_notus_path()

subroutine mod_file_manager::get_notus_path ( character(len=:), allocatable  path)
Parameters
[out]pathPath of Notus executable

◆ read_environment_variable()

character(len=:) function, allocatable mod_file_manager::read_environment_variable ( character(len=*), intent(in)  env,
logical, optional  is_fatal 
)
Parameters
[in]envName of the environment variable
[in]is_fatalOptional flag to stop Notus if the variable is not found

◆ replace_tilde_with_home()

character(len=:) function, allocatable mod_file_manager::replace_tilde_with_home ( character(len=*), intent(in)  path)

Also simplify path

Parameters
[in]pathAny path

◆ simplify_path()

character(len=:) function, allocatable mod_file_manager::simplify_path ( character(len=*), intent(in)  path)
Parameters
[in]pathString containing the path to simpify.