Contains functions and subroutines that inquire and operate on files including reading and writing multiple entries to a file
Checks whether the file with name fName exists on disk
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fName | File name to check |
Exists?
Checks if a file 'fname' is of type 'extension'
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fName | File name |
||
character(len=3), | intent(in) | :: | extension | Extension to find |
Has this extension?
Is the file open or not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fname | File name |
Is the file open?
Get the file size in Bytes
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fName | File name |
Size of the file
Counts the number of lines in a file after the number of specified header lines
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fName | File name |
||
integer(kind=i32), | intent(in), | optional | :: | nHeader | Skip this number of lines at the top of the file |
Number of lines in the file
Get the extension of a file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fName | File name |
File extension
Trims the extension of a filename
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fName | File name |
File name without the extension
Checks whether a file is open with an error message if not
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fName | File name |
Open a file and perform necessary checks for failure stat should be 'new','old','unknown','append'
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fname | File name |
||
integer(kind=i32), | intent(out) | :: | iunit | Unit number returned |
||
character(len=*), | intent(in) | :: | stat | Status of the file you are opening |
||
integer(kind=i32), | intent(out) | :: | istat | Error flag |
Open an unformatted binary file stat should be 'new','old','unknown','append'
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fname | File Name |
||
integer(kind=i32), | intent(out) | :: | iunit | Unit number returned |
||
character(len=*), | intent(in) | :: | stat | Status of the file you are opening |
||
integer(kind=i32), | intent(out) | :: | istat | Error Flag |
Close a file and perform any necessary checks
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fname | File name |
||
integer(kind=i32), | intent(in) | :: | iunit | Unit number returned |
||
character(len=*), | intent(in) | :: | stat | Status of the file you are closing |
||
integer(kind=i32), | intent(out) | :: | istat | Error Flag |
Deletes a file on disk
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fname | File name to delete |
Skip N lines in a file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i32), | intent(in) | :: | iunit | Unit number to skip |
||
integer(kind=i32), | intent(in) | :: | N | Number of lines to skip |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tester) | :: | test |