Sha256: 61b76408ac79f41edf6fcfb6709d84a8b0beb6c45ae2bf52d30026690e991adf

Contents?: true

Size: 1.25 KB

Versions: 71

Compression:

Stored size: 1.25 KB

Contents

#include <CoreServices/CoreServices.h>

static void callback(ConstFSEventStreamRef streamRef,
					 void *clientCallBackInfo,
					 size_t numEvents,
					 void *eventPaths,
					 const FSEventStreamEventFlags eventFlags[],
					 const FSEventStreamEventId eventIds[]) {
	exit(0);
}

int main (int argc, const char * argv[]) {
	// Show help
	if (argc != 2 || strncmp(argv[1], "-h", 2) == 0) {
		printf("Sleep until a file in or below the watchdir is modified.\n");
		printf("Usage: fsevent_sleep /path/to/watchdir\n");
		exit(1);
	}
	
	// Create event stream
	CFStringRef pathToWatch = CFStringCreateWithCString(kCFAllocatorDefault, argv[1], kCFStringEncodingUTF8);
    CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&pathToWatch, 1, NULL);	
    void *callbackInfo = NULL;
    FSEventStreamRef stream;
    CFAbsoluteTime latency = 1.0;
    stream = FSEventStreamCreate(
								 kCFAllocatorDefault,
								 callback,
								 callbackInfo,
								 pathsToWatch,
								 kFSEventStreamEventIdSinceNow,
								 latency,
								 kFSEventStreamCreateFlagNone
								 );
	
	// Add stream to run loop
    FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
	FSEventStreamStart(stream);
	CFRunLoopRun();
	
	// Exit
	return 2;
}

Version data entries

71 entries across 71 versions & 6 rubygems

Version Path
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.21/ext/fsevent/fsevent_sleep.c
autotest-fsevent-0.2.21 ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/fsevent_sleep.c
autotest-fsevent-0.2.20 ext/fsevent/fsevent_sleep.c
cloudsmith-api-1.142.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/fsevent_sleep.c
cloudsmith-api-1.120.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/fsevent_sleep.c