Originally Posted by
Epy
I know abachler made a CD/DVD burner in like 20-30 lines of code, that was pretty cool.
It's an ISO image ripper, it doesn't burn the CD or operate any hardware.
Depends what you mean by small. I did this last week when I was mirroring a site with wget and it took like 5 hours. See: text and manpage viewer for linux (my big project) will continuously "tail" a log file, that is, update the display at intervals as the file grows. But as I discovered, if the file is growing very very rapidly (like a wget log), it never catches up by the time the text makes it into the GUI (have to work on that...). So a crude text terminal method:
Code:
#include <stdio.h>
int main(int argc, char *argv[]) {
int bz = atoi(argv[2]);
char buf[bz];
FILE *in = fopen(argv[1],"r");
if (!in) {
perror("fopen: ");
return 0;
}
for (;;) {
while (fgets(buf,bz,in)) {
printf("%s",buf);
}
sleep(1);
}
return 0;
}
I think you can see what happens here (the args are the filename, and the max line length).
Of course, that is not really much of a project I liked writing a packet sniffer, if you are looking for something with some use value (now wifi is everywhere). 3D (openGL) graphics has an immediately gratifying angle to it, the API is fairly challenging.
But really -- learning a GUI API is great, because it opens up a lot of opportunities. After I finished downloading that site, I used this:
gdirtree.c
(there's a bunch of my old projects in that directory, some of them are sorta embarrassing )
It gives you a collapsable listing of an entire directory tree, including the total size and number of files, plus the same for each for each subdirectory (recursively).
I've also used gtk to add an interface to openGL stuff. So yeah, I would think of something you'd like out of that, pick an API, and start learning.