![]() |
(git:08825b9)
|
Utility routines to open and close files. More...
Functions/Subroutines | |
| subroutine, public | close_file (unit_number, file_status) |
| Closes an open file given by its logical unit number. | |
| subroutine, public | open_file (file_name, unit_number, file_status, file_form, file_action, file_position, file_pad, file_access, debug) |
| Opens a file and returns its logical unit number. | |
| logical function, public | file_exists (file_name) |
| Checks if a file exists, considering also the file discovery mechanism. | |
| character(len=default_path_length) function, public | discover_file (file_name) |
| Searches for a file in the current directory and then in the data directory. | |
| character(len=default_path_length) function, public | get_data_dir () |
| Returns path of data directory if set, otherwise an empty string. | |
| character(len=default_path_length) function, public | join_paths (path1, path2) |
| Joins two file paths, inserting '/' as needed. | |
Utility routines to open and close files.
| subroutine, public cp_files::close_file | ( | integer, intent(in) | unit_number, |
| character(len=*), intent(in), optional | file_status ) |
Closes an open file given by its logical unit number.
| unit_number | Logical unit number of the file to be closed |
| file_status | File status after closing: KEEP or DELETE (default: KEEP for named, DELETE for unnamed SCRATCH files) |
Definition at line 62 of file cp_files.F.
| subroutine, public cp_files::open_file | ( | character(len=*), intent(in), optional | file_name, |
| integer, intent(out) | unit_number, | ||
| character(len=*), intent(in), optional | file_status, | ||
| character(len=*), intent(in), optional | file_form, | ||
| character(len=*), intent(in), optional | file_action, | ||
| character(len=*), intent(in), optional | file_position, | ||
| character(len=*), intent(in), optional | file_pad, | ||
| character(len=*), intent(in), optional | file_access, | ||
| logical, intent(in), optional | debug ) |
Opens a file and returns its logical unit number.
| file_name | File name; must be omitted for an anonymous SCRATCH file |
| unit_number | Logical unit number of the opened file |
| file_status | Fortran file status OLD, NEW, REPLACE, UNKNOWN, or SCRATCH for an anonymous temporary file (default: OLD) |
| file_form | FORMATTED or UNFORMATTED (default: FORMATTED) |
| file_action | READ, WRITE, or READWRITE (default: WRITE for STATUS=NEW, REPLACE, and SCRATCH, otherwise READ) |
| file_position | ASIS, REWIND, or APPEND (default: REWIND) |
| file_pad | YES or NO (default: YES); only allowed for FORMATTED files |
| file_access | SEQUENTIAL or STREAM (default: SEQUENTIAL); DIRECT is not supported |
| debug | Print the connection properties to the default output unit |
Definition at line 194 of file cp_files.F.
| logical function, public cp_files::file_exists | ( | character(len=*), intent(in) | file_name | ) |
Checks if a file exists, considering also the file discovery mechanism.
| file_name | Name of the file |
Definition at line 516 of file cp_files.F.
| character(len=default_path_length) function, public cp_files::discover_file | ( | character(len=*), intent(in) | file_name | ) |
Searches for a file in the current directory and then in the data directory.
| file_name | Name of the file |
Definition at line 536 of file cp_files.F.
| character(len=default_path_length) function, public cp_files::get_data_dir |
Returns path of data directory if set, otherwise an empty string.
Definition at line 573 of file cp_files.F.
| character(len=default_path_length) function, public cp_files::join_paths | ( | character(len=*), intent(in) | path1, |
| character(len=*), intent(in) | path2 ) |
Joins two file paths, inserting '/' as needed.
| path1 | Leading path, e.g. a directory |
| path2 | Trailing path; returned unchanged if it is an absolute path |
Definition at line 607 of file cp_files.F.