PDA

View Full Version : See what files an app tries to open (and where)



probono
04-25-2004, 05:15 PM
Hi all,

do you want to see what files an app tries to open? E. g. you want to know where it looks for libraries and configuration files? Then call the app from a konsole with

strace -f -e open /path/and/name/of/the/app.sh

Konsole then shows all files as they are tried to open. So you can easily see what actually gets accessed when.

Btw, you can get the path of the app with
which nameoftheapp

probono

probono
11-19-2004, 06:04 PM
Here is a little KDE frontend that shows you which files a process tries to access. You can start any application, then this frontend, and it will tell you which files the application tries to open.

This is useful for debugging, and in order to know what's "going on"! I am using it when debugging klik.


#
# KDE frontend to see what files a process tries to open
#

PROCESSES=$(ps -e | gawk -F " " '{ print $1 " " $4}')
echo $PROCESSES
PID=$(kdialog --menu "Select a process to watch" $PROCESSES)

konsole --noclose --nomenubar --notabbar -e strace -e open -f -p $PID

Greetings,
probono