Meaning of filelocation = “../”//filename

。_饼干妹妹 提交于 2019-12-11 08:28:27

问题


    filelocation = "../"//filename
    PRINT *, "Attempting to open ", TRIM(filename)
    OPEN(fh1, FILE = filelocation, STATUS='old',IOSTAT = io)

Can anyone tell me please what is the meaning of "../"// in the first line?


回答1:


The string

../

is Linux for the parent directory of the current working directory. This may or may not work on a Windows machine. The two characters

//

represent the Fortran operator for string concatenation. So

"../"//filename

sets filelocation to refer to a file named filename in the parent directory of the directory the program thinks it is executing in.



来源:https://stackoverflow.com/questions/17210015/meaning-of-filelocation-filename

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!