Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Discover which programs prevent disk image ejection' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Discover which programs prevent disk image ejection
Authored by: mmnw on Jun 16, '08 08:24:15AM
Why use grep? lsof offers an option to specifically search a directory path, i.e.
lsof +D /Volumes/DODO
Note that the uppercase "D" is important, a lowercase "d" would only search the directory/volume itself and not include any subdirectories.

[ Reply to This | # ]
Discover which programs prevent disk image ejection
Authored by: PatrickS on Jun 16, '08 11:28:22AM
From lsof(1):
lsof may process this option slowly and require a large amount of dynamic memory to do it. This is because it must descend the entire directory tree, rooted at D, calling stat(2) for each file and directory, building a list of all the files it finds, and searching that list for a match with every open file. When directory D is large, these steps can take a long time, so use this option prudently.
So using grep may be the faster way after all.

/Pat

[ Reply to This | # ]