in reply to How to find all open STDERR and STDOUT dups?

tlm,
As I mentioned in /msg, the standard way would be fileno. Are these other filehandles available to you in your main code though? If not, it seems like symbol table hackery may in fact be the way to go.

Cheers - L~R

  • Comment on Re: How to find all open STDERR and STDOUT dups?

Replies are listed 'Best First'.
Re^2: How to find all open STDERR and STDOUT dups?
by educated_foo (Vicar) on Apr 01, 2009 at 01:11 UTC
    You actually want to stat stuff and compare the resulting device, inode, etc. fileno returns the descriptor, but dup creates a new file descriptor pointing to the same underlying file.