简体   繁体   中英

Be notified when folder contents changes - Objective-C

In my program I'd like to be notified when a user inserts a usb/firewire/etc drive in the computer.

I don't know if there is a special way just for drives, but I think there should be a way with normal folders. Since all external drives are in the /Volumes folder, I'd like a way to observe that folder and have a method called or something when it's contents change.

Use the File Systems Events API . It's C API, not an Objective-C API, but it's still perfectly usable from Objective-C.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM