Skip to content

Instantly share code, notes, and snippets.

@cxa
Last active December 11, 2015 15:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cxa/4618561 to your computer and use it in GitHub Desktop.
Save cxa/4618561 to your computer and use it in GitHub Desktop.
int fiddle = open("DOCUMENT_DIRECTORY", O_EVTONLY);
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VNODE, fiddle, DISPATCH_VNODE_WRITE, queue);
dispatch_source_set_event_handler(source, ^{
// how to determine if a file has finished copying?
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment