Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

fs_usage

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

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

You should be able to use lsof.

share|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
1  
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
add comment

Fseventer gives a nice visual representation.

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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