aboutsummaryrefslogtreecommitdiffstats
path: root/fbcopy.c
blob: bc4e07860e314e8f323e148af7d26ea12789cba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<stdio.h>
#include<stdlib.h>
#include<time.h>

int main(void) {
    FILE *fbp = fopen( "/dev/fb0", "r" );
    if (!fbp)
        exit(1);
    puts("Opened framebuffer for reading.");
    FILE *outfile = fopen( "/home/main/c-stuff/fbshot", "w" );
    if (!outfile)
        exit(1);
    puts("Opened outfile for writing.");
    char c;
    while ( (c = fgetc(fbp)) != EOF )
        fputc(c, outfile);
    puts("Finished writing to files. Closing.");
    fclose(fbp);
    fclose(outfile);
    puts("Finished.");
}