forlab file derived type. (Specification)
File constructs a File object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | filename | |||
character(len=*), | intent(in), | optional | :: | mode |
close
closes a file
object, deallocate file%filename
.
(Specification)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file), | intent(inout) | :: | self |
countlines
counts the number of lines in a txt file.
(Specification)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file), | intent(inout) | :: | self |
file_exist
determines whether a file
object already exists.
(Specification)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file), | intent(inout) | :: | self |
Open the file. (Specification)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(file), | intent(inout) | :: | self |
type file
character(:), allocatable :: filename
character(3) :: mode
integer :: unit
integer :: lines
contains
procedure :: exist => file_exist1
procedure :: open => open_file
procedure :: countlines => countlines1
procedure :: close
end type file