Hi,
I have a simple script that reads binary files (unformatted, direct access). I'd like to generalize this program to accept any fortran file and internally determine the size of the array (assuming 4 bytes per number). The program currently has a parameter that sets the size (number of records) in the file to be read.
The best way I can think to do this would be to use a function that returns the size of a file, in bytes or record lengths, given an input file.
Does anyone know of such a function, or how to write one, or have any other solution?
thanks,
guillaume
I have a simple script that reads binary files (unformatted, direct access). I'd like to generalize this program to accept any fortran file and internally determine the size of the array (assuming 4 bytes per number). The program currently has a parameter that sets the size (number of records) in the file to be read.
The best way I can think to do this would be to use a function that returns the size of a file, in bytes or record lengths, given an input file.
Does anyone know of such a function, or how to write one, or have any other solution?
thanks,
guillaume