[求助]fortran中是否有读取 二进文件大小的函数?
请教大家,fortran中 有没有能够获取一个二进制文件有多少byte的函数呢?
谢谢大家!
谢谢大家!
fstat函数就可以,我用的是g95编译器
FSTAT
INTEGER FUNCTION fstat(unit, sarray)
INTEGER, INTENT(IN) :: unit
INTEGER, INTENT(OUT) :: sarray(13)
END FUNCTION fstat
Obtains data about the file open on Fortran I/O unit and places them in the array sarray(). The values
in this array are extracted from the stat structure as returned by fstat(2) q.v., as follows:
sarray(1) Device number,
sarray(2) Inode number,
sarray(3) file mode,
sarray(4) number of links,
sarray(5) Owner uid,
sarray(6) Owner gid,
sarray(7) device type,
sarray(8) file size,
sarray(9) Access time,
sarray(10) Modifilcation time,
sarray(11) Change time,
sarray(12) Block size,
sarray(13) Allocated blocks.