{"id":26650958,"url":"https://github.com/opcoder0/fanotify","last_synced_at":"2025-04-11T04:41:26.896Z","repository":{"id":64300692,"uuid":"571836010","full_name":"opcoder0/fanotify","owner":"opcoder0","description":"Fanotify API for Go","archived":false,"fork":false,"pushed_at":"2023-09-03T01:56:12.000Z","size":95,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T02:48:57.143Z","etag":null,"topics":["fanotify","filesystem-events","filesystem-monitoring","filesystemwatcher","golang","linux"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opcoder0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-29T01:34:15.000Z","updated_at":"2024-10-30T08:16:44.000Z","dependencies_parsed_at":"2024-06-20T17:31:54.911Z","dependency_job_id":"090aa901-0f41-4fc1-96f7-36ae70c5dee3","html_url":"https://github.com/opcoder0/fanotify","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcoder0%2Ffanotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcoder0%2Ffanotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcoder0%2Ffanotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcoder0%2Ffanotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opcoder0","download_url":"https://codeload.github.com/opcoder0/fanotify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345276,"owners_count":21088242,"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":["fanotify","filesystem-events","filesystem-monitoring","filesystemwatcher","golang","linux"],"created_at":"2025-03-25T02:49:03.795Z","updated_at":"2025-04-11T04:41:26.864Z","avatar_url":"https://github.com/opcoder0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fanotify Library\n\n![Fanotify](https://github.com/opcoder0/fanotify/blob/main/images/fanotify.jpeg)\n\nFanotify library provides a simple API to monitor filesystem for events.\n\nThe listener is initialized with flags automatically based on the kernel version. The mark flag features that specify the\nthe events to monitor a file/directory are validated and checked for valid combinations and validated against the kernel\nversion.\n\nfanotify has features spanning different kernel versions -\n\n- For Linux kernel version 5.0 and earlier no additional information about the underlying filesystem object is available.\n- For Linux kernel versions 5.1 - 5.8 additional information about the underlying filesystem object is correlated to an event.\n- For Linux kernel version 5.9 or later the modified file name is made available in the event.\n\n## Examples\n\nExample code for different use-cases can be found here https://github.com/opcoder0/fanotify-examples\n\n## Known Issues\n\nCertain flag combinations / event types cause issues with event reporting.\n\n- `fanotify.FileCreated` cannot be or-ed / combined with `fanotify.FileClosed`. The `fanotify` event notification group does not generate any event for this combination.\n- Using `fanotify.FileOpened` with any of the event types containing `OrDirectory` causes numerous duplicate events for the path.\n- `fanotifyFileOrDirectoryOpened` with any of the other event types causes numerous duplicate events for the path.\n\n## Tests\n\nRunning tests require `CAP_SYS_ADM` privilege. To run the tests make sure to add `go` to the `sudo` PATH.\n\nThe command runs all the tests except the ones that test the flag bugs mentioned in the \"Known Issues\" section above -\n\n```\nsudo go test -v\n```\n\nTo run the tests with flag issues -\n\n```\nsudo go test -v -bug\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopcoder0%2Ffanotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopcoder0%2Ffanotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopcoder0%2Ffanotify/lists"}