I need to develop a library that opens a file and parses the stuff.
The unit number, due to fortran IO style, must be decided by me, but I can’t know what other units are open in the client code. Is there a standard function like give_me_any_unit_number_that_is_free() ?
I need to develop a library that opens a file and parses the stuff.
Share
In fortran 2008, there’s a newunit clause to open that you can use
but that’s new enough that not all compilers support it yet. If yours doesn’t yet, you can mock one up yourself; there’s a good example on the fortran wiki.