explaingit

rakyll/fsnotify

Analysis updated 2026-08-01 · repo last pushed 2013-07-03

GoAudience · developerComplexity · 2/5DormantSetup · easy

TLDR

fsnotify is a Go library that lets your program automatically detect when files or folders are created, modified, deleted, or renamed, without constantly checking for changes.

Mindmap

mindmap
  root((repo))
    What it does
      Watches files and folders
      Detects create modify delete rename
      Sends events to your app
    Tech stack
      Go
      Cross-platform
    Use cases
      Desktop backup tools
      Auto-reload config files
      File synchronizers
    Audience
      Go developers
      Tool builders
    Setup notes
      Watch each folder separately
      Manage background processes

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a desktop backup tool that instantly flags files for upload when a user saves them.

USE CASE 2

Create a web server that automatically reloads its configuration the moment an admin edits it.

USE CASE 3

Build a file synchronizer that reacts instantly when files on disk change.

What is it built with?

Go

How does it compare?

rakyll/fsnotify0verflowme/cloudflared0verflowme/pulumi-vultr
LanguageGoGoGo
Last pushed2013-07-032024-10-192022-12-26
MaintenanceDormantStaleDormant
Setup difficultyeasymoderatehard
Complexity2/52/53/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

No special infrastructure needed, just import the Go package and start watching file paths, though developers must manually add watchers for each directory since subfolders are not watched automatically.

The license is not specified in the project documentation, so permission terms are unknown.

In plain English

fsnotify is a tool for programmers building applications in the Go language. It lets your software automatically notice the moment a file or folder is created, modified, deleted, or renamed, without having to constantly check for changes manually. This is especially useful for apps like file synchronizers or code tools that need to react instantly when something on the computer's disk changes. In technical terms, the library provides a "watcher" that you point at a specific file path. Once the watcher is running, it sends a message to your application every time a relevant action happens to that path. For each event, your app receives the name of the file and exactly what happened to it, allowing your program to trigger a specific response immediately after the event occurs. A developer building a desktop backup tool, for instance, could use this to instantly flag a document for upload the second a user saves it. Or a web server might use it to automatically reload its configuration files the moment an administrator makes an edit. The library is designed to work seamlessly across Windows, macOS, and Linux, which means a developer can write the file-watching logic once and trust it will run reliably on any of those operating systems. The project makes a few notable choices that developers should be aware of. Watching a folder does not automatically mean it watches the subfolders inside it, developers have to set up watchers for each specific directory they care about. Additionally, the current setup requires the developer to manage background processes to listen for the file events and potential errors, though the project notes it is looking into a simpler approach.

Copy-paste prompts

Prompt 1
I want to use the rakyll/fsnotify Go library to watch a folder and print a message every time a file is created or modified in it. Write the Go code for me, including how to set up the watcher and read events.
Prompt 2
Using rakyll/fsnotify in Go, I need to watch my config.yaml file and automatically reload my configuration whenever it changes. Show me how to implement this pattern.
Prompt 3
Help me use rakyll/fsnotify to watch multiple directories in Go and handle the fact that subfolders are not watched automatically. Write code that adds a watcher for each directory I specify.
Prompt 4
I am building a Go application with rakyll/fsnotify. Show me how to handle both file change events and any errors from the watcher in a select loop, and explain how to properly close the watcher when done.

Frequently asked questions

What is fsnotify?

fsnotify is a Go library that lets your program automatically detect when files or folders are created, modified, deleted, or renamed, without constantly checking for changes.

What language is fsnotify written in?

Mainly Go. The stack also includes Go.

Is fsnotify actively maintained?

Dormant — no commits in 2+ years (last push 2013-07-03).

What license does fsnotify use?

The license is not specified in the project documentation, so permission terms are unknown.

How hard is fsnotify to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is fsnotify for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.