mojomother
Programmer
Is there any way to read an entire file into an ALLOCATABLE buffer in Fortran? Say I have the code
What needs to happen afterwards to read the entire file "file_name" into file_buffer? The file might be big (~ 5 MB).
The way I'm trying to do it, I keep getting "input statement requires too much data" errors.
Thanks in advance!
Matt
Code:
CHARACTER, DIMENSION(:), ALLOCATABLE :: file_buffer
file_size = get_file_size(filename)
ALLOCATE(file_buffer(file_size))
What needs to happen afterwards to read the entire file "file_name" into file_buffer? The file might be big (~ 5 MB).
The way I'm trying to do it, I keep getting "input statement requires too much data" errors.
Thanks in advance!
Matt