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

How to get a file length in ifort 8.1?

ncwerons
Beginner
433 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
433 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