I donβt believe that there is any portable way, but, for example, on Linux you can invoke readlinkon "/proc/self/fd/fileno ", and the kernel will give you a path if it can, or one of the different types of funny strings if not.
hobbs source
share