Re: CPU temperature monitoring in C++?



kimiraikkonen wrote:

Seems that you did not read my previous message of this topic. I know
some programs which monitors temp. I just want to know how they're
coded and how i can write a basic cpu temp reader code.

That depends on your platform. With linux that information is available
through a file interface in the /proc directory tree. So in effect the only
thing anyone needs to do to get the system temperature is read a plain text
file. The same thing applies to other system properties.

Here is a small example. The cat program simply reads the file and outputs
it's content to the standard output.

<example>
rui@ubuntu:~$ cat /proc/acpi/thermal_zone/THRC/temperature
temperature: 50 C
rui@ubuntu:~$ cat /proc/acpi/thermal_zone/THRS/temperature
temperature: 41 C
</example>


Rui Maciel
.