Skip to content

Instantly share code, notes, and snippets.

@mmisono
Created April 1, 2010 05:58
Show Gist options
  • Save mmisono/351443 to your computer and use it in GitHub Desktop.
Save mmisono/351443 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const* argv[])
{
int temp = 0;
char unit;
FILE *file = fopen("/Users/mfumi/.screen/.temp","r");
if(file != NULL){
fscanf(file,"%d %c",&temp,&unit);
fclose(file);
}
system("/Users/mfumi/.screen/tempmonitor > /Users/mfumi/.screen/.temp &");
printf("%d\n",temp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment