Search code examples
macoscocoafiledetection

Detecting removal and addition of files/folders cocoa


I would like to get an idea of how to detect if a folder or file was removed or added to a specified folder listed in my code, there is not much to elaborate on.


Solution

  • Use File System Events.

    The file system events API provides a way for your application to ask for notification when the contents of a directory hierarchy are modified.

    Take a look at Using the File System Events API

    The File System Events API consists of several distinct groups of functions. You can obtain general information about volumes and events by using functions that begin with FSEvents.