Talk:Read entire file: Difference between revisions

m
(→‎Fortran: new section)
Line 14:
 
There was some stuff pretending that it's impossible to read the file into memory, and that the only way is some convoluted loop, with goto (!). Sorry, that's wrong as of the current Fortran standard. I replaced this garbage with an example allocating a character string exactly the right size, and reading the file in stream access.
 
It's of course not the ''only'' way: it's possible to read file blocks, but here it is asked to read an entire file.
Also, production code would control errors.
 
I also showed another example using Intel Fortran, that makes use of the Windows API to create a memory map of the file.
Anonymous user