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

查看:16
本文介绍了使用 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天全站免登陆