Difference between revisions of "Anydrive.c"

From Organic Design wiki
m
m
Line 5: Line 5:
  
 
int main() {
 
int main() {
char c = 'B';
+
int c = 'C';
 
char file[20], cmd[20];
 
char file[20], cmd[20];
do sprintf(file,"%c:\\index.html",c = (char)(((int)c)+1));
+
do sprintf(file,"%c:\\index.html",c++);
 +
 
 
while ((open(file,O_RDONLY)<0) && (c <= 'Z'));
 
while ((open(file,O_RDONLY)<0) && (c <= 'Z'));
 
if (c <= 'Z') system(file);
 
if (c <= 'Z') system(file);

Revision as of 08:47, 10 November 2006

  1. include <stdlib.h>
  2. include <stdio.h>
  3. include <string.h>
  4. 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!"); return 0; }