使用Fortran获取以字节为单位的文件大小的好方法是什么? [英] What is a good way to get file size in bytes using Fortran?

查看:310
本文介绍了使用Fortran获取以字节为单位的文件大小的好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Intel Fortran在Fortran中获取文件大小?

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

我正在使用stat,它在gfortran中效果很好,但是在ifort中不可用.

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

推荐答案

INQUIRE(FILE=filename, SIZE=file_size)

filename是字符标量,file_size是整数标量,将以文件存储单元中文件的大小(ifort中的以字节为单位")定义,或者如果无法确定大小,则为-1.

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.

这篇关于使用Fortran获取以字节为单位的文件大小的好方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆