|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re: Finding out by one process a filename opened by another process.by Jeppe (Monk) |
| on Aug 01, 2012 at 10:21 UTC ( #984751=note: print w/ replies, xml ) | Need Help?? |
|
If you have the PID, then the shell command lsof -p will list all files opened by that PID. Also, lsof <filename> will list the processes that have opened a specific file. Etc. lsof is a very powerful command, and it requires root access, so you'll have to provide password-less sudo access for the user executing the script in order for this solution to work.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||