Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29269 Discussions

How to get size of file in Intel Fortran?

brb36641
Beginner
1,137 Views
Hello,
Some one give me any idea to solve this issue, please.
I wonder that Intel Fortran should recommend how to check size of file in source code.
e.g. INQUIRE and some specifier of it
My idea is recl specifier of INQURE. I attempt to use it.
Actual sorce code
---------------------------------------------------------------------
integer record-length
INQUIRE(file='st-file',recl=record-lenght)
write (*,*) 'st-file length',record-lenght
---------------------------------------------------------------------
Then the last 'write' uncorrect size of st-file.
What's wrong? Please let me know how to solve.
Thanks.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,137 Views
File length is not record length. All INQUIRE (RECL=) will tell you is the value used in an OPEN to open a current unit. Otherwise no value is available.

What you want is GETFILEINFOQQ.
0 Kudos
brb36641
Beginner
1,137 Views

Hi, Thank you , Steve.

Let me ask you one further question.

Will GETFILEINFOQQ workin Conpaq Fortran as same as in Intel Fortran?

0 Kudos
Steven_L_Intel1
Employee
1,137 Views
Yes, exactly the same. If you want your source code to work with both compilers, use USE DFLIB to make the routine available.
0 Kudos
brb36641
Beginner
1,137 Views
Dear Steve,
Thank you very much for helpful suggestion.
My problem was immediately solved by your favor.

Thank you again.
0 Kudos
Reply