Difference between revisions of "Anydrive.c"
From Organic Design wiki
m |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
#include <string.h> | #include <string.h> | ||
#include <fcntl.h> | #include <fcntl.h> | ||
− | |||
int main() { | int main() { | ||
− | + | int c = 'C'; | |
− | + | char file[20], cmd[20]; | |
− | + | do sprintf(file,"%c:\\index.html",c++); | |
− | + | while ((open(file,O_RDONLY)<0) && (c <= 'Z')); | |
− | |||
− | |||
− | |||
− | + | if (c <= 'Z') system(file); else printf("No can do sir!\n"); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | return 0; | |
− | + | } |
Latest revision as of 09:58, 13 November 2006
- include <stdlib.h>
- include <stdio.h>
- include <string.h>
- include <fcntl.h>
int main() {
int c = 'C'; char file[20], cmd[20];
do sprintf(file,"%c:\\index.html",c++); while ((open(file,O_RDONLY)<0) && (c <= 'Z'));
if (c <= 'Z') system(file); else printf("No can do sir!\n");
return 0; }