in reply to Detecting Files used by a shell command

Take a look at:

ldd will give you the idea of shared library dependancies, while strings might be used on a file to get the ASCII staff out, which is grepable afterwords.

Also, RedHat Package Manager (RPM) sources can be interesting for you, since the functionality you seek is somewhat implemented there. (Check the /usr/lib/rpm directory if you have RPM-based Linux machine handy).

Leonid Mamtchenkov aka TVSET

Replies are listed 'Best First'.
Re: Re: Detecting Files used by a shell command
by dpuu (Chaplain) on Jul 15, 2003 at 00:08 UTC
    Thanks for the reply, but those things don't really help: they aren't run-time mechanisms. Imagine gcc didn't have the "-MD" option: how would you know what header files are used (without preprocessing the C files)? strace tells you precisely which files gcc reads. Other programs don't have a -MD equivalent, hence the desire to trace system-calls at run time. Anyone who's used Clearcase (clearmake) should understand how nice it is to write makefiles without dependencies. Dave.