Some routines to deal with files
Todo
rm -rf dir-name
Function that returns the system directory separator
Subroutine that keeps only the directory from a file path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | file_path |
Subroutine that keeps only the file from a path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | file_path |
Function that returns true if the operating system is linux
Function that removes the characters of a string from another string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
string to be modified |
||
character(len=*), | intent(in) | :: | chars |
list of characters to remove |
returned string
Function that replaces a string with another string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
string to be modified |
||
character(len=*), | intent(in) | :: | old_str | |||
character(len=*), | intent(in) | :: | new_str | |||
integer(kind=I4), | intent(in) | :: | place |
returned string
Subroutine that removes all files with extension .scratch
Subroutine that returns a list of subdirectories
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in), | optional | :: | str |
Subroutine that returns a list of files in a directory
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | dir | |||
character(len=512), | intent(out), | allocatable, dimension(:) | :: | list | ||
character(len=*), | intent(in), | optional | :: | ext |
Subroutine that creates the folders of a file path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | wkd | |||
character(len=*), | intent(in) | :: | file_path | |||
integer(kind=I4), | intent(out) | :: | exit_status |
Subroutine that creates a directory
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | wkd | |||
character(len=*), | intent(in) | :: | directory | |||
character(len=1), | intent(in) | :: | sep | |||
integer(kind=I4), | intent(out) | :: | exit_status |
Subroutine that creates a vector containing the folders of a file path
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | file_path | |||
character(len=512), | intent(out), | dimension(:), allocatable | :: | vec_path |
Subroutine that creates a path from vector of folders
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=:), | intent(out), | allocatable | :: | file_path | ||
character(len=512), | intent(in), | dimension(:) | :: | vec_path |