Hi,
I am using the USEROPEN specifier of the OPEN statement. My useropen function changes the name of the file bering opened. Put another way, the name of the file that is actually opened is not the one that was specified in the OPEN statement.
That all works fine, except for one thing.
The INQUIRE statement's NAME specifier returns the filename that was passed to the OPEN statement, not the name of the file that was actually opened.
Is there a way for me have the INQUIRE statement return the name of the file actually opened for the name specifier?
Many thanks,
Leigh.
I am using the USEROPEN specifier of the OPEN statement. My useropen function changes the name of the file bering opened. Put another way, the name of the file that is actually opened is not the one that was specified in the OPEN statement.
That all works fine, except for one thing.
The INQUIRE statement's NAME specifier returns the filename that was passed to the OPEN statement, not the name of the file that was actually opened.
Is there a way for me have the INQUIRE statement return the name of the file actually opened for the name specifier?
Many thanks,
Leigh.
連結已複製
4 回應
Thanks.
Following on from your suggestion, is there a way for me to obtain the file handle associated with a unit?
I have seen the PXFFILENO routine in the POSIX compatibility module. That seems to have too many preconditions.
Thanks again,
Leigh.
Following on from your suggestion, is there a way for me to obtain the file handle associated with a unit?
I have seen the PXFFILENO routine in the POSIX compatibility module. That seems to have too many preconditions.
Thanks again,
Leigh.
Steve,
I was just thinking that myself.
I'm planning to just store unit number, file handle pairs. Then, if I need to, I can get the path using GetFinalPathNameByHandle() (I hope).
I need to do some special processing around file deletions. My approach is to replace CLOSE(unit=n, status='delete') by CALL MYCLOSE(unit=n, status='delete'). It would be nice if the MYCLOSE subroutine can work out the file to operate on just from the the unit number.
Anyway, thnaks for the help.
Leigh.
I was just thinking that myself.
I'm planning to just store unit number, file handle pairs. Then, if I need to, I can get the path using GetFinalPathNameByHandle() (I hope).
I need to do some special processing around file deletions. My approach is to replace CLOSE(unit=n, status='delete') by CALL MYCLOSE(unit=n, status='delete'). It would be nice if the MYCLOSE subroutine can work out the file to operate on just from the the unit number.
Anyway, thnaks for the help.
Leigh.
