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

file name from unit number

Dan__Calin
Beginner
511 Views

Hi,

Is there a way to obtain the file name associated to a unit number?

I tried:

inquire(unit=14, opened=openedq, file=name_of_file)

but I've got an error:

error #7934: An INQUIRE statement must contain only one FILE= specifier, one UNIT= specifier or one DIRECTORY= specifier. [FILE]

Is there another way to obtain the file name associated to an unit number?

Thanks,

Calin

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
512 Views

You want NAME=, not FILE=.

View solution in original post

0 Kudos
2 Replies
Steve_Lionel
Honored Contributor III
513 Views

You want NAME=, not FILE=.

0 Kudos
Dan__Calin
Beginner
512 Views

Thanks Steve!

Calin

0 Kudos
Reply