{"id":23168833,"url":"https://github.com/chris-huxtable/cbhfilesystemeventkit","last_synced_at":"2025-04-04T22:44:59.007Z","repository":{"id":56904216,"uuid":"223262524","full_name":"chris-huxtable/CBHFileSystemEventKit","owner":"chris-huxtable","description":"An easier way to watch for file system events.","archived":false,"fork":false,"pushed_at":"2019-11-23T15:12:31.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T11:47:35.655Z","etag":null,"topics":["fsevent","fsevents","objective-c","objective-c-library"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-huxtable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-21T20:46:23.000Z","updated_at":"2019-11-23T15:53:33.000Z","dependencies_parsed_at":"2022-08-20T18:50:38.695Z","dependency_job_id":null,"html_url":"https://github.com/chris-huxtable/CBHFileSystemEventKit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHFileSystemEventKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHFileSystemEventKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHFileSystemEventKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-huxtable%2FCBHFileSystemEventKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-huxtable","download_url":"https://codeload.github.com/chris-huxtable/CBHFileSystemEventKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261581,"owners_count":20910107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fsevent","fsevents","objective-c","objective-c-library"],"created_at":"2024-12-18T03:13:48.939Z","updated_at":"2025-04-04T22:44:58.991Z","avatar_url":"https://github.com/chris-huxtable.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CBHFileSystemEventKit\n\n[![release](https://img.shields.io/github/release/chris-huxtable/CBHFileSystemEventKit.svg)](https://github.com/chris-huxtable/CBHFileSystemEventKit/releases)\n[![pod](https://img.shields.io/cocoapods/v/CBHFileSystemEventKit.svg)](https://cocoapods.org/pods/CBHFileSystemEventKit)\n[![licence](https://img.shields.io/badge/licence-ISC-lightgrey.svg?cacheSeconds=2592000)](https://github.com/chris-huxtable/CBHFileSystemEventKit/blob/master/LICENSE)\n[![coverage](https://img.shields.io/badge/coverage-98%25-brightgreen.svg?cacheSeconds=2592000)](https://github.com/chris-huxtable/CBHFileSystemEventKit)\n\nAn easier way to watch for file system events.\n\n\n## Use\n\nThe starting point of any use is `CBHFileSystemWatcher`. It is used to describe what kind of file system events you want to get and how/where you want to receive them. When an event matching the description occurs the callback is invoked and passed a `CBHFileSystemEvent` which describes where and what happened.\n\n#### Examples:\n\nWatch the contents of a directory with a block:\n```objective-c\n// [...]\n\nNSString *path = @\"/path/to/directory/to/watch\";\nCBHFileSystemWatcherType type = CBHFileSystemWatcherType_default;\nid someContext = nil;\n\nCBHFileSystemWatcher *watcher = [CBHFileSystemWatcher watcherOfPath:path withType:type andBlock:^(CBHFileSystemEvent *event) {\n\t// Do something with the event and someContext.\n}];\n\n// [...]\n```\n\nWatch the contents of a directory with an observer:\n```objective-c\n// [...]\n\n- (void)watchPath\n{\n\tNSString *path = @\"/path/to/directory/to/watch\";\n\tCBHFileSystemWatcherType type = CBHFileSystemWatcherType_default;\n\tSEL selector = @selector(_fileSystemEventOccurred:);\n\tid someContext = nil;\n\n\t_watcher = [CBHFileSystemWatcher watcherWithObserver:self andSelector:selector ofPath:path withType:type andObject:someContext];\n}\n\n- (void)_fileSystemEventOccurred:(CBHFileSystemEvent *)event\n{\n\tid context = [event object];\n\t// Do something with the event.\n}\n\n// [...]\n```\n\n## Licence\nCBHFileSystemEventKit is available under the [ISC license](https://github.com/chris-huxtable/CBHFileSystemEventKit/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-huxtable%2Fcbhfilesystemeventkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-huxtable%2Fcbhfilesystemeventkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-huxtable%2Fcbhfilesystemeventkit/lists"}