On Linux, if you can dig down to a file descriptor number, you can examine /proc/pid/fd/fdnum to see what file or socket it references.
On Windows, if you can dig down to a file handle, you can use a tool like Sys Internals Process Explorer to trace the handle to a physical file.
On a Darwin/BSD system you would use opensnoop.