{"id":20010118,"url":"https://github.com/cxa/cxadirectorycontentswatcher","last_synced_at":"2025-07-28T14:08:54.779Z","repository":{"id":6582667,"uuid":"7824977","full_name":"cxa/CXADirectoryContentsWatcher","owner":"cxa","description":"Watch for a directory whenever a file is added or removed","archived":false,"fork":false,"pushed_at":"2017-12-12T15:09:35.000Z","size":16,"stargazers_count":30,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-04T19:40:01.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cxa.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":"2013-01-25T17:30:39.000Z","updated_at":"2023-11-03T19:04:39.000Z","dependencies_parsed_at":"2022-09-15T16:21:25.290Z","dependency_job_id":null,"html_url":"https://github.com/cxa/CXADirectoryContentsWatcher","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cxa/CXADirectoryContentsWatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FCXADirectoryContentsWatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FCXADirectoryContentsWatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FCXADirectoryContentsWatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FCXADirectoryContentsWatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cxa","download_url":"https://codeload.github.com/cxa/CXADirectoryContentsWatcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxa%2FCXADirectoryContentsWatcher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267527835,"owners_count":24102019,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T07:18:29.681Z","updated_at":"2025-07-28T14:08:54.538Z","avatar_url":"https://github.com/cxa.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CXADirectoryContentsWatcher\n\nTo handle files added or removed from iTunes File Sharing while app running motivates me to create this project.\n\nWatching for the changes of a directory contents is easy with GCD `dispatch_source_t`, but to determine whether a file finished copying or not is very hard. With `DISPATCH_VNODE_ATTRIB` mask, the source will send an event when file will finish, if lucky we can receive another event after the copying is completely finished, but not always especially there are multiple files copying. So I do it the hard way, poll to check file size changing, when current size is equal to last check, I assume the copying job is done.\n\nAny suggestion is welcome, seeking for the elegant solutions.\n\n## Header at a glance\n\n    @protocol CXADirectoryContentsWatcherDelegate \u003cNSObject\u003e\n    \n    - (void)directoryWatcher:(CXADirectoryContentsWatcher *)dirWatcher didFinishCopyItemAtURL:(NSURL *)fileURL isReplacement:(BOOL)isReplacement;\n    - (void)directoryWatcher:(CXADirectoryContentsWatcher *)dirWatcher didRemoveItemAtURL:(NSURL *)fileURL;\n    \n    @end\n    \n    @interface CXADirectoryContentsWatcher : NSObject\n    \n    @property (nonatomic, weak) id \u003cCXADirectoryContentsWatcherDelegate\u003e delegate;\n    @property (nonatomic, strong, readonly) NSURL *directoryURL;\n    \n    - (instancetype)initWithDirectoryURL:(NSURL *)dirURL delegate:(id \u003cCXADirectoryContentsWatcherDelegate\u003e)delegate;\n    - (BOOL)start;\n    - (void)stop;\n    \n    @end\n\n## Creator\n\n* Twitter: [@_cxa](https://twitter.com/_cxa)\n* Apps available on the App Store: \u003chttp://lazyapps.com\u003e\n* PayPal: xianan.chen+paypal 📧 gmail.com, buy me a cup of coffee if you find it's useful for you.\n\n## License\n\nCXADirectoryContentsWatcher is released under the MIT license. In short, it's royalty-free but you must you keep the copyright notice in your code or software distribution.\n\nFor non attributed commercial lisence, please contact.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxa%2Fcxadirectorycontentswatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcxa%2Fcxadirectorycontentswatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxa%2Fcxadirectorycontentswatcher/lists"}