What's blind about it? Reading files is nicer than parsing ps output or needing to write native code over a syscall.
Not sure if relevant to this discussion, but here's the problems I've experienced working with files for system devices:
[1] here's just a discovery of a logitech mouse receiver, notice that it touches:
* /sys/class/*
* /sys/module/*
* /sys/class/hidraw/*/device/driver
I must take care that each dir might not be present, symlinks may be dangling, and access to multiple files is not atomic.It would be much easier and stable using just one SQLite query, for example.
[1] https://github.com/Lekensteyn/ltunify/blob/master/ltunify.c#...