I tried that tracefile
. For me it gave much less matches than my own strace ... | sed ... | sort -u
. I even added -s256
to strace(1)
command line but it did not help much...
Then I tried that loggedfs
. First it failed since I did not have read/write access to the directory I tried to log with it. After doing chmod 755 temporarily I did get some hits...
But, for me, doing the following seems to work best:
inotifywait -m -r -e OPEN /path/to/traced/directory
And then postprocess the output after running the process of interest.
This doesn't catch the files process access outsice of the
traced directory nor this doesn't know whether some other
process accessed the same directory tree, but in many cases
this is good enough tool to get the job done.
EDIT: inotifywait does not catch symlink access (just the targets
after symlinks resolved). I was hit by this when I archived libraries
accessed by a program for future use. Used some extra perl glob hackery
to pick the symlinks along the notified libraries to get the job
done in that one particular case.
EDIT2: at least when inotifying files and symlinks themselves from inotifywait command line (e.g. inotifywait -m file symlink
or inotifywait symlink file
) output will show access to which one is first in command line (regardless which, file
of symlink
is accessed). inotifywait does not support IN_DONT_FOLLOW -- which, when
I tried programmatically just makes one see access to file
(which may,
or may not, be what one expects...) regardless of order in command line
strace
, I assume you're specifically interested in Linux. Correct?