I'm debugging the initialization of a program (on a mac) and would I'd like to get a list of all the files opened during the execution, preferably in time order. Can this be done?

link|improve this question

25% accept rate
feedback

3 Answers

up vote 4 down vote accepted

fs_usage

And I need some more characters in this box, but I'm not sure what else to say...

link|improve this answer
This does what I want (although the -w option doesn't work). – eaubin Sep 29 '10 at 2:46
feedback

You should be able to use lsof.

link|improve this answer
I can use the lsof -r option, but there's no certainty that I'll get the whole set of files opened. – eaubin Sep 29 '10 at 0:33
@eaubin: You might be able to use ktrace. – Dennis Williamson Sep 29 '10 at 0:42
Turns out ktrace isn't available on my machine, but dtrace can do it: sudo dtrace -s /dev/stdin syscall::open*:entry { printf("%s %s", execname, copyinstr(arg0)); } Ctrl-D (from hints.macworld.com/article.php?story=20071031121823710) – eaubin Sep 29 '10 at 11:53
feedback

Fseventer gives a nice visual representation.

http://fernlightning.com/doku.php?id=software:fseventer:start&s[]=org

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.