开发者

Fast way to check if file is open on OS X

开发者 https://www.devze.com 2023-02-13 06:01 出处:网络
Is there a fast way to check if a file handle is closed from the command line 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

精彩评论

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