port-filename

[procedure] port-filename port

SCM: returns the filename associated with port. If port is not a file port, the result is unspecified.

Some implementations have port-name which does the similar thing. STklos has port-file-name. Bigloo has input-port-name.