Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good way to get file size in bytes using Fortran?

Is there a way to get the filesize in Fortran using Intel Fortran?

I was using stat which works great in gfortran, but it is not available in ifort.

like image 782
Isopycnal Oscillation Avatar asked Jul 17 '13 23:07

Isopycnal Oscillation


Video Answer


1 Answers

INQUIRE(FILE=filename, SIZE=file_size)

filename is a character scalar, file_size is an integer scalar that will be defined with the size of the file in file storage units ("in bytes" on ifort), or -1 if the size cannot be determined.

like image 200
IanH Avatar answered Sep 30 '22 03:09

IanH