Fortran end of file error when input file is not in src folder -


i have small fortran program:

integer :: ok real :: x character(len=80) :: name name="test.txt" open(1,file=name,status='old',iostat=ok) print *,ok read(1,*) x close(1) print *,x 

and works now. when (of course put file in dir)

name="/data/test.txt" 

or

name = "../data/input.txt" 

i error:

at line 8 of file test.f90 (unit = 1, file = 'fort.1') fortran runtime error: end of file 

i use gfortran compiler. update: absolute path "/users/name/documents/fortran/data/input.txt" works too!


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -