FortranFile
FortranFile_
is user data type designed to access the features of fortran file system.
API
- First Initiate the file by using the Initiate
- Then open the file by using the Open
- Then close the file by using the Close
- To deallocate the file you can use Deallocate. It will close the file too.
Constructor methods
Method name | comment |
---|---|
Initiate | Initiate the instance |
Deallocate | Deallocate data and close the file |
Open | Open the file |
Close | close the file |
Delete | Delete the file |
Backspace | Go back one record |
Rewind | Rewind the file |
Set methods
Method name | comment |
---|---|
SetFilePath | Set the file path |
SetFileName | Set the file name |
SetFileExt | Set the file extension |
SetEOFStat | Set the end of file status |
SetOpenStat | Set the open status |
SetReadStat | Set the read status |
SetWriteStat | Set the write status |
SetStatus | Set the status of the file |
Get methods
Method name | comment |
---|---|
GetFilePath | Get the path of the file |
GetFileName | Get the name of the file |
GetFileExt | Get the extension of the file |
GetFileParts | Get the parts of the file |
Enquire methods
Method name | comment |
---|---|
IsOpen | This function returns true if the file is open. |
IsEOF | This returns true if the end of file is reached. |
IsRead | This returns true if the file has read access. |
IsWrite | This returns true if the file has write access. |
All methods
📄️ Backspace
Move one line back
📄️ Close
Close the Fortran file.
📄️ Deallocate
Deallocate the content of Fortran file, you can delete the file if you want. Note that we have overridden the deallocate method defined for AbstractFile_.
📄️ Delete
Delete the fortran file.
📄️ Structure
FortranFile is an extension of AbstractFile. It provides a simplified interface to the native Fortran file capabilities and includes error checking.
📄️ GetRecLen
Get the length of the record
📄️ GetUnitNo
Get the unit number of the fortran file
📄️ Initiate
Initiate the fortran file. See example [[FortranFiletest1]] and [[FortranFiletest2]]
📄️ IsDirect
Returns true if direct access
📄️ IsFormatted
Returns true if the file is formatted
📄️ IsInitiated
Returns true if the file is initiated
📄️ IsNew
Returns true if the file is new
📄️ IsOverwrite
Returns true if overwrite status is set
📄️ IsPadded
Returns true if padded
📄️ Open
Open the Fortran file.
📄️ Rewind
Move to the begining
📄️ SetStatus
Set the status of the file.