A CLI tool for FreeBSD / MacOS that monitors a directory for filesystem events and writes them to a logfile.
  • C++ 98.2%
  • Makefile 1.8%
Find a file
2026-03-25 09:56:54 +01:00
src chore: incorrect handling of EINTR 2026-03-25 09:18:50 +01:00
.gitignore feat: add reader utility 2026-03-24 16:05:31 +01:00
compile_commands.json initial commit 2026-03-23 09:43:07 +01:00
Makefile feat: add reader utility 2026-03-24 16:05:31 +01:00
README.md update readme and mark project complete 2026-03-25 09:56:54 +01:00

Logwatch

A simple MacOS / FreeBSD utility that monitors directories for filesystem events and writes them to a log file.

Introduction

I made this program as a test of my skills with program design and to learn more about FreeBSD / MacOS. In terms of functionality it is quite simple but also useful if you are doing system analysis.

The software was written in a mix of plain C and C++23 and uses kqueue to monitor the events.

Usage

# Writer
./logwatch "dir_to_watch" "output_file.bin"

# Reader
./logread "input_file.bin" # same as the output of the writer

Note: You must first have output from the writer to use the reader

References

These are some articles, docs and git repositories that helped me create this utility: