My program accesses a text data file that the user may have open in a text editor. The program needs to know (1) if the user has updated the file since my program last read it, e.g. by the user SAVING it, and (2) if the user has updated the file by CLOSING it in his editor.
I can use the Fortran STAT function to get the system time of the data file, and comparing that to the previous system time enables my program to detect an updated file. This will happen in either case (1) or (2). But how can I determine simply if the data file is still open (in the users editor) or not?
I thought perhaps I could use Fortran INQUIRE (FILE=filename, OPENED=op) to do this, but my testing shows that op will only be true if filename is open to the program, and false if it is open to some other app.