to add, ive tested(compiled) my code on cygwin, it works ok, directories and files have different mode_t output, but still on win32, it doesnt...sigh!
--- In [email protected], "int21h_d" <[EMAIL PROTECTED]> wrote: > > does the gnu c lib for file system interface (readdir, opendir, stat, > etc) only works(rather i say, perfectly works) on POSIX platforms?? if > yes, what library can i use for win32??? > > to be more precise, > > struct dirent *ep; > struct stat *file_stat; > char buff[80]; > DIR *dir; > > dir = opendir("."); > while(ep = readdir(dir)) { > if(strcmp(ep->d_name, ".") != 0 && > strcmp(ep->d_name, "..") != 0) { > sprintf(buff, "\\%s", ep->d_name); > stat(buff, file_stat); > printf("[%d] : %s\n", file_stat->st_mode, ep->d_name); > } > } > closedir(dir); > > the code above outputs the same file types for every file/directory it > read from readdir, that goes for oridinary(text) files and directories > only, not tested for other file types, since other file types will be > irrelevant specifically for what i am doing... or is it i am just > missing something??? > > thanks in advance > > > ---ynth >
