in reply to how to know the files opened by a process
For an OS that has a /proc, you can File::Find on the /proc/\d+/fd/ nodes. They will be a symlink to the opened files of each process currently running.
# ls -l /proc/####/fd/ total 3 lr-x------ 1 root root 64 Dec 26 02:46 0 -> /proc/kmsg lrwx------ 1 root root 64 Dec 26 02:46 1 -> socket:[11384] lr-x------ 1 root root 64 Dec 26 02:46 2 -> /boot/System.map-2.6.14-2- +k7
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to know the files opened by a process
by tirwhan (Abbot) on Dec 26, 2005 at 09:38 UTC |