A quick way to check if a file is open on OS X

Is there a quick way to check if a file descriptor is closed from the command line on os x?

lsof works, of course, but very slowly.

+5
source share
1 answer

You probably want to check out the DTrace family man dtrace.

If you are only interested in “file actions”, you should take a look at opensnoopwhich is based on DTrace and was included with Mac OS X 10.6. You can show the entire file used by the process (using -p pid or -n name) and watch files with -f / path / to / file.

+4
source

All Articles