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

I used stat, which works fine in gfortran, but it is not available in ifort. Is there a way to get the file size using ifort?

+4
source share
1 answer
INQUIRE(FILE=filename, SIZE=file_size) 

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

+7
source

Source: https://habr.com/ru/post/1491982/


All Articles