{"id":37130743,"url":"https://github.com/bububa/fsnotify","last_synced_at":"2026-01-14T15:01:49.631Z","repository":{"id":57527735,"uuid":"20953937","full_name":"bububa/fsnotify","owner":"bububa","description":"File system notification for Go","archived":false,"fork":true,"pushed_at":"2014-06-17T11:54:36.000Z","size":221,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-16T20:32:23.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"howeyc/fsnotify","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bububa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-18T07:52:04.000Z","updated_at":"2014-06-18T07:52:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bububa/fsnotify","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/bububa/fsnotify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bububa%2Ffsnotify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bububa%2Ffsnotify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bububa%2Ffsnotify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bububa%2Ffsnotify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bububa","download_url":"https://codeload.github.com/bububa/fsnotify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bububa%2Ffsnotify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-14T15:01:48.956Z","updated_at":"2026-01-14T15:01:49.618Z","avatar_url":"https://github.com/bububa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# File system notifications for Go\n\n[![Build Status](https://goci.herokuapp.com/project/image/github.com/howeyc/fsnotify)](http://goci.me/project/github.com/howeyc/fsnotify) [![GoDoc](https://godoc.org/github.com/howeyc/fsnotify?status.png)](http://godoc.org/github.com/howeyc/fsnotify)\n\nCross platform, works on:\n* Windows\n* Linux\n* BSD\n* OSX\n\n### Moving Notice\n\nWe plan to include os/fsnotify in the Go standard library with a new [API](http://goo.gl/MrYxyA). \n\n* Import `code.google.com/p/go.exp/fsnotify` ([GoDoc](http://godoc.org/code.google.com/p/go.exp/fsnotify)) for the latest API under development.\n* Continue importing `github.com/howeyc/fsnotify` ([GoDoc](http://godoc.org/github.com/howeyc/fsnotify)) for the stable API.\n* [Report Issues](https://code.google.com/p/go/issues/list?q=fsnotify) to go.exp/fsnotify after testing against `code.google.com/p/go.exp/fsnotify`\n* Join [golang-dev](https://groups.google.com/forum/#!forum/golang-dev) to discuss fsnotify.\n* See the [Contribution Guidelines](http://golang.org/doc/contribute.html) for Go and sign the CLA.\n\n### Example:\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/howeyc/fsnotify\"\n)\n\nfunc main() {\n\twatcher, err := fsnotify.NewWatcher()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdone := make(chan bool)\n\n\t// Process events\n\tgo func() {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase ev := \u003c-watcher.Event:\n\t\t\t\tlog.Println(\"event:\", ev)\n\t\t\tcase err := \u003c-watcher.Error:\n\t\t\t\tlog.Println(\"error:\", err)\n\t\t\t}\n\t\t}\n\t}()\n\n\terr = watcher.Watch(\"testDir\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t\u003c-done\n\n\t/* ... do stuff ... */\n\twatcher.Close()\n}\n```\n\nFor each event:\n* Name\n* IsCreate()\n* IsDelete()\n* IsModify()\n* IsRename()\n\n### FAQ\n\n**When a file is moved to another directory is it still being watched?**\n\nNo (it shouldn't be, unless you are watching where it was moved to).\n\n**When I watch a directory, are all subdirectories watched as well?**\n\nNo, you must add watches for any directory you want to watch (a recursive watcher is in the works [#56][]).\n\n**Do I have to watch the Error and Event channels in a separate goroutine?**\n\nAs of now, yes. Looking into making this single-thread friendly (see [#7][])\n\n**Why am I receiving multiple events for the same file on OS X?**\n\nSpotlight indexing on OS X can result in multiple events (see [#62][]). A temporary workaround is to add your folder(s) to the *Spotlight Privacy settings* until we have a native FSEvents implementation (see [#54][]).\n\n**How many files can be watched at once?**\n\nThere are OS-specific limits as to how many watches can be created:\n* Linux: /proc/sys/fs/inotify/max_user_watches contains the limit,\nreaching this limit results in a \"no space left on device\" error.\n* BSD / OSX: sysctl variables \"kern.maxfiles\" and \"kern.maxfilesperproc\", reaching these limits results in a \"too many open files\" error.\n\n\n[#62]: https://github.com/howeyc/fsnotify/issues/62\n[#56]: https://github.com/howeyc/fsnotify/issues/56\n[#54]: https://github.com/howeyc/fsnotify/issues/54\n[#7]: https://github.com/howeyc/fsnotify/issues/7\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbububa%2Ffsnotify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbububa%2Ffsnotify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbububa%2Ffsnotify/lists"}