Created
May 18, 2014 17:07
-
-
Save woglinde/288be733db0913420e00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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