查看Mac OS X中使用文件的过程 [英] See what process is using a file in Mac OS X
问题描述
我希望能够跟踪文件并查看哪个进程正在触摸该文件.那可能吗?我知道我可以在活动监视器中看到打开的进程的列表,但是我认为它正在迅速发生.这样做的原因是我正在使用一个框架,并且我认为该框架的系统版本正在使用,而不是调试版本,所以我想看看哪个进程正在使用它.
I would like to be able to track a file and see which process is touching that file. Is that possible? I know that I can see the list of open processes in activity monitor but I think it's happening to quickly for me to see it. The reason for this is I'm using a framework and I think the system version of the framework is being used instead of the debug version and I'd like to see which process is touching it.
推荐答案
lsof
将列出打开的文件,但是对于短暂的触摸可能会有些尴尬(例如,如果在运行lsof时文件未打开,则它会不显示).
lsof
will list open files, but it can be a bit awkward for momentary touches (eg, if the file isn't open when lsof runs, it doesn't show).
I think your best bet would be fernLightning's fseventer.app. It's "nagware", and allows you to watch (graphically) the fsevents API in real-time.
这篇关于查看Mac OS X中使用文件的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!