in reply to Reverse engineering a file handle

Is this a *nix platform? If so you really shouldn't even try. Sure you can muck around the /proc filesystem for answers but it seems so icky. If you really really really need the input and output filenames in our output file, then you should skip the redirection and support command line args for input and output:

myprog --input <file> --output <file>
-derby