I'm implementing a free space on disk bar where while files are being copied, the free space bar updates. I need some way of being notified of file system changes. What's the best way to go about doing this?
+4
A:
The File System Events Programming Guide has all the info you need. You want to register with the File System Events API (OS X 10.5 and later).
Barry Wark
2009-09-30 23:46:40
Stu Connolly has a great Objective-C wrapper for the FSEvents C API called SCEvents. You can get it here:http://stuconnolly.com/blog/scevents-011/
Rob Keniger
2009-10-01 03:37:19
+1
A:
To monitor operations on individual files you can use kqueue file change notifications. Uli Kusterer has a nice Obj-C wrapper called UKKQueue.
You can get it here: http://zathras.de/angelweb/sourcecode.htm
If you want to watch an entire folder, FSEvents (and the SCEvents wrapper) will probably be of more use.
Nick Forge
2009-10-01 05:09:28
Up-to-date versions of this code can now be found at GitHub: http://github.com/uliwitness/UliKit
Nick Forge
2010-03-09 03:27:38