What I'd like to do is just develop a little program that outputs the battery level as a percentage, but I can't find a way to do this without invoking the shell. I want to only use system libraries.
OK, I've decided to revert to using the shell. My operating system (Mac) has a program I'd like to use called System Profiler. I'm having a little problem, though. I get an errno of 29 after fell.
OK, error 29 means "illegal seek", meaning seek operations on pipes aren't valid.
Instead, what I need to do is create a char[] array that acts as a buffer, a temporary holding place for each line of output. This buffer can then be appended to a C++ string.