RosettaCodeData/Task/Read-entire-file/Fortran/read-entire-file-1.f
2016-12-05 22:15:40 +01:00

14 lines
314 B
Forth

program read_file
implicit none
integer :: n
character(:), allocatable :: s
open(unit=10, file="read_file.f90", action="read", &
form="unformatted", access="stream")
inquire(unit=10, size=n)
allocate(character(n) :: s)
read(10) s
close(10)
print "(A)", s
end program