http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60596
--- Comment #6 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- character(25) :: the filename inquire(unit=input_unit, name=thefilename) print *, "The name is: ", trim(thefilename) Before closing the input gives a hint, but maybe not the whole file path.