Skip to content

Instantly share code, notes, and snippets.

@woglinde
Created May 18, 2014 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woglinde/288be733db0913420e00 to your computer and use it in GitHub Desktop.
Save woglinde/288be733db0913420e00 to your computer and use it in GitHub Desktop.
FILE* pipe = popen("/system/bin/screencap -p", "r");
char buffer[100];
while(!feof(pipe)) {
if(fgets(buffer, 100, pipe) != NULL){
printf("snapshot taken\n");
}
if (send(new_fd, buffer, 100, 0) == -1)
perror("send");
}
close(new_fd);
pclose(pipe);
exit(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment