21625f40b5
I tried to get the latest versions from dockapps.org, but I haven't tested any of them. More dockapps will be added as time permits.
24 lines
416 B
C
24 lines
416 B
C
#include <stdio.h>
|
|
|
|
int i;
|
|
FILE *fd;
|
|
int temp;
|
|
char *buf;
|
|
|
|
|
|
main() {
|
|
buf=(char *)malloc(sizeof(char)*512);
|
|
for (i=0;i<20000;i++) {
|
|
if ((fd = fopen("/proc/acpi/battery/BAT0/state", "r"))) {
|
|
bzero(buf, 512);
|
|
fseek(fd,57,0);
|
|
fscanf(fd, "charging state: %s", buf);
|
|
|
|
printf("We are at loop %d and charging is %s\n",i,buf);
|
|
fclose(fd);
|
|
}
|
|
}
|
|
free(buf);
|
|
}
|
|
|