I am working on unit tests for code that deals with the File System Events API. It creates a directory tree with random data in files and subdirectories, and then performs a few changes on these files and test that changes are handled properly.
However, this only works when the files are created in some user-space directory, such as on my own Desktop. When I try to put the test files somewhere like /tmp
or the location of NSTemporaryDirectory()
, the listener does not receive any events. Are changes within directories such as /var
and /tmp
not recorded by the File System events API at all? Or is this an issue with permissions on those directories? I am not using the Sandbox for this portion of my app.
Update
The issue was elsewhere in my code, File System Events do apply to the entire file system. See the below answer for my somewhat unrelated fix.