开发者

Fast way to check if file is open on OS X

Is there a fast way to check if a file handle is closed from the command line on 开发者_运维技巧os x?

lsof works, of course, but is super slow.


You´ll probably want to check out the DTrace Family man dtrace.

If you´re only interested on pure "file actions" you should have a look at opensnoop, which builds on DTrace and has been included since Mac OS X 10.6. You can show all file in use by a process (by -p pid or -n name) and watch files with -f /path/to/file .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜