There might also be some operating system API to get that information.

Cheers,
_