1

I am working on a simple Disk utility type application. I would like to add a feature that lists which running application's are currently accessing a particular disk. I'm not really sure which Cocoa Class implements this.

Just to elaborate, the closest description of what I'm looking for is the alert that appears when trying to unmount a disk in use. The alert goes something like "Disk so and so can not eject because application so and so is using it." How do I check which applications are currently accessing a specific drive.

Hope someone can point me in the right direction.

Larme
  • 24,190
  • 6
  • 51
  • 81
deptowicz
  • 11
  • 2
  • What do you mean by "XCode Class"? XCode is just an IDE. – Larme Apr 30 '14 at 09:45
  • You'll have to use the `FSEvents` API for this; watching the top-level directory of whatever filesystem you are interested in. – trojanfoe Apr 30 '14 at 09:50
  • Corrected description... I meant Cocoa Class. – deptowicz May 01 '14 at 15:09
  • By "accessing" a disk, you mean have files open on a disk, so it's related to [this question](http://stackoverflow.com/questions/8317177/see-what-process-is-using-a-file-in-mac-os-x). – JWWalker May 01 '14 at 17:24
  • @JWWalker yes it's related to that question. I know this can be done thru NSTask lsof +D but I'm wondering if there's a Cocoa class that already does it. – deptowicz May 01 '14 at 22:26

0 Answers0