I\'m trying to get information like OS version, hard disk space, disk space available, and installed RAM on a Linux system in C++. I know I can use system()
to run
There is nothing in the C++ Standard library for these purposes. The library you could use is libhal
, which abstracts the view of programs to the hardware, collecting various informations from /proc
, /sys
and others. HAL, scroll down, there seems to be an unofficial C++ binding available too (haven't tested it though, while libhal works also fine for C++ programs). Use the command lshal
to display all device informations available to HAL.