{"id":17965229,"url":"https://github.com/tokenrove/erl-dirwatch","last_synced_at":"2026-05-19T14:33:04.259Z","repository":{"id":147613062,"uuid":"61128022","full_name":"tokenrove/erl-dirwatch","owner":"tokenrove","description":"Simple directory watching for Erlang","archived":false,"fork":false,"pushed_at":"2017-01-24T20:52:24.000Z","size":725,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T13:02:03.741Z","etag":null,"topics":["erlang","inotify","kqueue","library","simplest-possible-thing"],"latest_commit_sha":null,"homepage":"https://github.com/adgear/erl-dirwatch","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tokenrove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-14T14:08:32.000Z","updated_at":"2018-02-18T16:56:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"5117a1a7-1293-4239-9914-c3122ff547e5","html_url":"https://github.com/tokenrove/erl-dirwatch","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Ferl-dirwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Ferl-dirwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Ferl-dirwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Ferl-dirwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokenrove","download_url":"https://codeload.github.com/tokenrove/erl-dirwatch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230036793,"owners_count":18163053,"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":["erlang","inotify","kqueue","library","simplest-possible-thing"],"created_at":"2024-10-29T12:10:33.293Z","updated_at":"2026-05-19T14:33:04.226Z","avatar_url":"https://github.com/tokenrove.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n**You probably don't want to use this.**\n\nIf you have serious file watching needs, you are probably looking for\n[synrc/fs](https://github.com/synrc/fs).\n\nThis provides absolutely minimal directory watching for Erlang; just\nenough to support `bertconf`.\n\nThat is, for each directory specified, we watch only this directory\nfor move, create, and delete events, and do not setup recursive\nwatches.\n\nUses `inotify` on Linux, `kqueue` on BSDs.\n\nDoes _not_ use `fsevents` on OS X, and probably never will: the only\nexposed API requires you to use a `CFRunLoop`, even though I'm sure\nthere's a nice UNIX-y `fd` in there somewhere.\n\nIt would have been nice to do this as a NIF that returns an fd from\ninotify and used `open_port({fd, ...` and Erlang's binary matching to\nparse inotify messages, but this wouldn't permit us to handle other\nOSes where less-UNIX-y approaches are used.  Instead we use a\nlinked-in driver which allows us to do the right thing for inotify,\nand still offers some portability options.\n\n== Building\n\n```\nrebar3 compile\n```\n\n== Usage\n\n=== `dirwatch:start(Self, Path, CooldownMs = 5000) -\u003e {ok,Handle} | {error,_}`\n\nStart watching the files in `Path`.  After events have occurred, will\nwait `CooldownMs` before sending a message of the form\n`{dirwatch,Handle,changed}` to the `Self` process.\n\nThe dirwatch process referred to by `Handle` monitors `Self` and\nterminates if it terminates.\n\n=== `dirwatch:stop(Handle) -\u003e ok | {error,_}`\n\nExplicitly stops a dirwatch process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenrove%2Ferl-dirwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokenrove%2Ferl-dirwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenrove%2Ferl-dirwatch/lists"}