Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Tags: tywkeene/go-fsevents

Tags

v0.2.0

Toggle v0.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
ReadSingleEvent: fixes and improvements (#22)

* ReadSingleEvent: fix buffer size

According to inotify(7),

> Specifying a buffer of size
>
>          sizeof(struct inotify_event) + NAME_MAX + 1
>
> will be sufficient to read at least one event.

Fix the size accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

* ReadSingleEvent: use unix.Read

This calls the read(2), so it is as good as C.read()
but without a need for cgo.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

* ReadSingleEvent: fix error handling

Since read(2) returns -1 in case of error, the actual reading error
was never returned because the bytesRead < unix.SizeofInotifyEvent
check was performed first.

Reverse the order of checks to fix.

Drop "else" since it's not needed after 'return'.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

v0.1.0

Toggle v0.1.0's commit message
Remove unnecessary return err in NewWatcher

v0.0.31

Toggle v0.0.31's commit message
Merge branch 'testing'