Automatically rerun a build or test script whenever a source file changes in your project folder.
Trigger a deployment or reload step whenever a config file is modified on a server.
Embed file-watching capability in your own C or Go application using the included libfswatch library.
| emcrisostomo/fswatch | luau-lang/luau | cinder/cinder | |
|---|---|---|---|
| Stars | 5,532 | 5,528 | 5,525 |
| Language | C++ | C++ | C++ |
| Setup difficulty | easy | hard | hard |
| Complexity | 2/5 | 4/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Linux inotify backend does not detect changes made over a network or through certain low-level memory operations.
fswatch is a command-line tool that watches files and folders on your computer and tells you when anything changes. You point it at a file or directory, and it will print a notification every time that file is created, modified, deleted, or renamed. This makes it useful for building automated workflows, like automatically rerunning a script whenever a source file changes. One of the tool's main strengths is that it runs on many operating systems, including macOS, Linux, Windows, and various BSD-based systems. Rather than using a single approach everywhere, it picks the method that works best on each platform. On macOS it uses Apple's built-in file system events system. On Linux it uses a kernel feature called inotify. On Windows it uses a Windows API call. There is also a fallback method that works anywhere, which checks for changes by polling the file system on a schedule. fswatch supports watching entire directory trees recursively, so you do not need to list every subfolder separately. You can also filter which files trigger a notification using text patterns, so you could watch only files ending in a certain extension while ignoring others. The format of the output is configurable, meaning you can pipe it into other tools in custom ways. The project also ships a companion library called libfswatch, which developers can include in their own C, C++, or Go programs if they want to add file-watching capabilities directly to an application rather than calling the command-line tool. Each underlying monitoring method has trade-offs. The Linux inotify approach, for example, does not track changes made over a network or through certain low-level memory operations. The BSD kqueue approach opens a file descriptor for every file being watched, so it can run into system limits when monitoring a very large number of files. The README covers these limitations in detail so you can choose the right backend for your situation.
A command-line tool that watches files and folders and prints a notification whenever something changes, useful for automating tasks like rerunning build scripts whenever source files are edited.
Mainly C++. The stack also includes C++, C, Go.
Open source and free to use in any project including commercial ones.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.