Skip to content

Commit b4b8bde

Browse files
committed
Update package documentation and README
1 parent 3a6bd70 commit b4b8bde

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Fanotify Library
22

3-
Fanotify library for Go provides a simple API to monitor filesystem for specific events. The library attempts to simplify specifying events/actions to the watcher by providing valid flag combinations. The flag features are validated against the user's kernel version.
3+
Fanotify library provides a simple API to monitor filesystem for events.
44

5-
Many of the useful features provided by [fanotify](https://man7.org/linux/man-pages/man7/fanotify.7.html) are available from Linux kernel 5.1 onwards. Most of the useful features availabe through this library work best on kernels 5.1 or later.
5+
The listener is initialized with flags automatically based on the kernel version. The mark flag features that specify the
6+
the events to monitor a file/directory are validated and checked for valid combinations and validated against the kernel
7+
version.
68

7-
## Example: Listener watching for file/directory accessed events
9+
fanotify has features spanning different kernel versions -
10+
11+
For Linux kernel version 5.0 and earlier no additional information about the underlying filesystem object is available.
12+
For Linux kernel versions 5.1 - 5.8 additional information about the underlying filesystem object is correlated to an event.
13+
For Linux kernel version 5.9 or later the modified file name is made available in the event.
14+
15+
## Example: Listener watching for events
816

917
```
1018
package main

fanotify_api.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
//go:build linux
22
// +build linux
33

4+
// Package fanotify library provides a simple API to monitor filesystem for events.
5+
//
6+
// The listener is initialized with flags automatically based on the kernel version. The mark flag features that specify the
7+
// the events to monitor a file/directory are validated and checked for valid combinations and validated against the kernel
8+
// version.
9+
//
10+
// fanotify has features spanning different kernel versions -
11+
//
12+
// For Linux kernel version 5.0 and earlier no additional information about the underlying filesystem object is available.
13+
// For Linux kernel versions 5.1 - 5.8 additional information about the underlying filesystem object is correlated to an event.
14+
// For Linux kernel version 5.9 or later the modified file name is made available in the event.
415
package fanotify
516

617
import (

0 commit comments

Comments
 (0)