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

2019-07-26 07:16发布

    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条回答
劫难
2楼-- · 2019-07-26 07:57

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.

查看更多
登录 后发表回答