Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

How to get a file length in ifort 8.1?

ncwerons
Beginner
438 Views
I need to check length of a file after opening it in my code written in F77. Can I do it using just one procedure like NFSIZE() in MS FORTRAN or FILESIZE() in WATCOM FORTRAN? I learned I could use the procedure GETFILEINFOQQ() but it seems to me a little complicated. Is there any simpler way?

Pawel
0 Kudos
1 Reply
user1
Beginner
438 Views

CHARACTER FILE_NAME*128
INTEGER*4, EXTERNAL :: STAT
INTEGER*4 STATB(12), IS, FILE_LEN
! ...
IS = STAT ( FILE_NAME, STATB )
IF ( IS .NE. 0 ) THEN
! Error message ...
END IF
FILE_LEN = STATB(8)
! ...

Enjoj!

Leonid
P.S. You may need -Vaxlib option for linking
0 Kudos
Reply