2

Is it possible to listen to some notification that triggers upon file modification, such as rename or move?

Currently, I created a bookmark to a file, stored its last modified date (thanks to this great post: Keep a reference to a file after it has moved in objective-c?), and then my application sets a timer that compares the bookmark's URL's last modified date, and acts upon changes.

My question is - is it possible to listen to some event, perhaps some mechanism similar to NSWorkspaceDidPerformFileOperationNotification, in order to monitor my directory's modifications, instead of using a timer?

Thanks, Nili

Community
  • 1
  • 1
Nili
  • 1,963
  • 3
  • 20
  • 39

1 Answers1

1

There are several ways to accomplish your goal:

To watch a single file, you'll probably be most happy with NSFileCoordinator.

Community
  • 1
  • 1
mahal tertin
  • 3,239
  • 24
  • 41