1 # File system notifications for Go |
1 # File system notifications for Go |
2 |
2 |
3 [![GoDoc](https://godoc.org/github.com/fsnotify/fsnotify?status.svg)](https://godoc.org/github.com/fsnotify/fsnotify) [![Go Report Card](https://goreportcard.com/badge/github.com/fsnotify/fsnotify)](https://goreportcard.com/report/github.com/fsnotify/fsnotify) |
3 [![Go Reference](https://pkg.go.dev/badge/github.com/fsnotify/fsnotify.svg)](https://pkg.go.dev/github.com/fsnotify/fsnotify) [![Go Report Card](https://goreportcard.com/badge/github.com/fsnotify/fsnotify)](https://goreportcard.com/report/github.com/fsnotify/fsnotify) [![Maintainers Wanted](https://img.shields.io/badge/maintainers-wanted-red.svg)](https://github.com/fsnotify/fsnotify/issues/413) |
4 |
4 |
5 fsnotify utilizes [golang.org/x/sys](https://godoc.org/golang.org/x/sys) rather than `syscall` from the standard library. Ensure you have the latest version installed by running: |
5 fsnotify utilizes [`golang.org/x/sys`](https://pkg.go.dev/golang.org/x/sys) rather than [`syscall`](https://pkg.go.dev/syscall) from the standard library. |
6 |
|
7 ```console |
|
8 go get -u golang.org/x/sys/... |
|
9 ``` |
|
10 |
6 |
11 Cross platform: Windows, Linux, BSD and macOS. |
7 Cross platform: Windows, Linux, BSD and macOS. |
12 |
8 |
13 | Adapter | OS | Status | |
9 | Adapter | OS | Status | |
14 | --------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | |
10 | --------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | |
15 | inotify | Linux 2.6.27 or later, Android\* | Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify) | |
11 | inotify | Linux 2.6.27 or later, Android\* | Supported | |
16 | kqueue | BSD, macOS, iOS\* | Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify) | |
12 | kqueue | BSD, macOS, iOS\* | Supported | |
17 | ReadDirectoryChangesW | Windows | Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify) | |
13 | ReadDirectoryChangesW | Windows | Supported | |
18 | FSEvents | macOS | [Planned](https://github.com/fsnotify/fsnotify/issues/11) | |
14 | FSEvents | macOS | [Planned](https://github.com/fsnotify/fsnotify/issues/11) | |
19 | FEN | Solaris 11 | [In Progress](https://github.com/fsnotify/fsnotify/issues/12) | |
15 | FEN | Solaris 11 | [In Progress](https://github.com/fsnotify/fsnotify/pull/371) | |
20 | fanotify | Linux 2.6.37+ | [Planned](https://github.com/fsnotify/fsnotify/issues/114) | |
16 | fanotify | Linux 2.6.37+ | [Maybe](https://github.com/fsnotify/fsnotify/issues/114) | |
21 | USN Journals | Windows | [Maybe](https://github.com/fsnotify/fsnotify/issues/53) | |
17 | USN Journals | Windows | [Maybe](https://github.com/fsnotify/fsnotify/issues/53) | |
22 | Polling | *All* | [Maybe](https://github.com/fsnotify/fsnotify/issues/9) | |
18 | Polling | *All* | [Maybe](https://github.com/fsnotify/fsnotify/issues/9) | |
23 |
19 |
24 \* Android and iOS are untested. |
20 \* Android and iOS are untested. |
25 |
21 |
26 Please see [the documentation](https://godoc.org/github.com/fsnotify/fsnotify) and consult the [FAQ](#faq) for usage information. |
22 Please see [the documentation](https://pkg.go.dev/github.com/fsnotify/fsnotify) and consult the [FAQ](#faq) for usage information. |
27 |
23 |
28 ## API stability |
24 ## API stability |
29 |
25 |
30 fsnotify is a fork of [howeyc/fsnotify](https://godoc.org/github.com/howeyc/fsnotify) with a new API as of v1.0. The API is based on [this design document](http://goo.gl/MrYxyA). |
26 fsnotify is a fork of [howeyc/fsnotify](https://github.com/howeyc/fsnotify) with a new API as of v1.0. The API is based on [this design document](http://goo.gl/MrYxyA). |
31 |
27 |
32 All [releases](https://github.com/fsnotify/fsnotify/releases) are tagged based on [Semantic Versioning](http://semver.org/). Further API changes are [planned](https://github.com/fsnotify/fsnotify/milestones), and will be tagged with a new major revision number. |
28 All [releases](https://github.com/fsnotify/fsnotify/releases) are tagged based on [Semantic Versioning](http://semver.org/). |
33 |
|
34 Go 1.6 supports dependencies located in the `vendor/` folder. Unless you are creating a library, it is recommended that you copy fsnotify into `vendor/github.com/fsnotify/fsnotify` within your project, and likewise for `golang.org/x/sys`. |
|
35 |
29 |
36 ## Usage |
30 ## Usage |
37 |
31 |
38 ```go |
32 ```go |
39 package main |
33 package main |