[ xxxrugby @ 08.04.2005. 22:45 ] @
Zamisao je da dam put (path) u odredjeni direktorij i onda sve sta je u njemu pokrenem. Npr. Imam na CD-u hrpu patcheva za Windowse. I tada uneses path = e://patches/ i sada on pokrece sve fileove unutar njega nesto kao system("patch.exe"). Code: #include <dirent.h> #include <stdio.h> int main(void) { DIR *d; struct dirent *dir; /* char *path; */ d = opendir("."); /* d = opendir(path) */ if (d) { while ((dir = readdir(d)) != NULL) { printf("%s\n", dir->d_name); /* something like system(dir->d_name); but this not working for me */ } closedir(d); } return(0); } Trenutno to pokusavam napravit za Win OS! |