C program, linux.
Focus on making it work for me first, then figure out how to make it portable and efficient
Not a big project, something interesting though to start with
https://github.com/MeanEYE/Disk-Indicator/ works but is a bit complex, incorporates Xorg and command line client.
- Based on a much simpler (albeit in C++) program: https://stahlke.org/dan/hdd_led/
Need to make fp an unbuffered stream with setvbuf (fp, NULL, _IONBF, 0);. This flushes writes to the leds as soon as they are written.
I only need: daemon that watches when disk activity file is changed (read or written) and sets LED to 1 for a few ms, then off.
https://www.kernel.org/doc/Documentation/block/stat.txt
Looks like there's only one file that has all values together.
Also I'm not sure if files from /sys can be watched with inotify API.