The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 08-07-2007
Perderabo's Avatar
Perderabo Perderabo is offline
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,711
In the case of "prog_a | prog_b", prog_b won't have any name associated with FD 0. There are lots of problems like that. lsof is a program that can display pretty good info for most FD's of most processes, but it must run suid'ed to root. Get lsof and run it to see if that sort of info could help you. If so, use popen() to run lsof from your process and parse the lsof output to get what you need. Something like this is the only way.
Reply With Quote