Taco Steemers

A personal blog.

Why I like the filesystem as an interface to the OS

A short while ago I made a post about a daemon that I have developed . This daemon needs information about connected storage devices and their mounted partitions. There is currently only a Linux version. I tried to develop a Windows version too (in the same code base even) but that effort stranded at some point. Developing the daemon for Linux was easy. It simply required reading the correct files from /proc , /sys and /dev .

Initially I tried to develop both versions at the same time. I looked at what daemons on Linux and services on Windows generally look like. I took a look at getting a small piece of code that could fork on both platforms. Then I looked at accessing information about hardware. Using C on Windows, things look to be massively less simple, and less easy as well. Windows Management Instrumentation seems most promissing, but (parts of) it appear(s) to need to be installed on some clients , and the amount of code required to retrieve the needed information seems massive. Using C#'s libraries, the daemon's functionality looks easy to implement on Windows. Maybe a bit easier and less complex than it was using C on Linux, even. But C# also requires the installation of a runtime, something I would really like to avoid.

Everyone that can program can write a program that reads files from the file system, and they can educate themselves about which files they need simply by reading them. But as soon as you have to use complex series of commands that are not well documented and may not (easily) be available to your programming language, development- or client environment, educating oneself becomes less easy and developing your program becomes more complex.