|
|
| version 1.7, 2004/01/13 16:30:21 | version 1.8, 2004/01/14 16:15:49 |
|---|---|
| Line 1 | Line 1 |
| #define VERBOSE(s) printf s | |
| #include "compiler.h" | #include "compiler.h" |
| #include <sys/stat.h> | #include <sys/stat.h> |
| Line 234 file_list1st(const char *dir, FLINFO *fl | Line 236 file_list1st(const char *dir, FLINFO *fl |
| mileuc_ncpy(eucpath, dir, sizeof(eucpath)); | mileuc_ncpy(eucpath, dir, sizeof(eucpath)); |
| file_setseparator(eucpath, sizeof(eucpath)); | file_setseparator(eucpath, sizeof(eucpath)); |
| ret = opendir(eucpath); | ret = opendir(eucpath); |
| VERBOSE(("file_list1st: opendir(%s)\n", eucpath)); | |
| if (ret == NULL) { | if (ret == NULL) { |
| VERBOSE(("file_list1st: opendir failure")); | |
| return FLISTH_INVALID; | return FLISTH_INVALID; |
| } | } |
| if (file_listnext((FLISTH)ret, fli) == SUCCESS) { | if (file_listnext((FLISTH)ret, fli) == SUCCESS) { |
| return (FLISTH)ret; | return (FLISTH)ret; |
| } | } |
| VERBOSE(("file_list1st: file_listnext failure\n")); | |
| closedir(ret); | closedir(ret); |
| return FLISTH_INVALID; | return FLISTH_INVALID; |
| } | } |
| Line 252 file_listnext(FLISTH hdl, FLINFO *fli) | Line 257 file_listnext(FLISTH hdl, FLINFO *fli) |
| de = readdir((DIR *)hdl); | de = readdir((DIR *)hdl); |
| if (de == NULL) { | if (de == NULL) { |
| VERBOSE(("file_listnext: readdir failure\n")); | |
| return FAILURE; | return FAILURE; |
| } | } |
| if (stat(de->d_name, &sb) != 0) { | if (stat(de->d_name, &sb) != 0) { |
| VERBOSE(("file_listnext: stat failure\n")); | |
| return FAILURE; | return FAILURE; |
| } | } |
| Line 269 file_listnext(FLISTH hdl, FLINFO *fli) | Line 276 file_listnext(FLISTH hdl, FLINFO *fli) |
| cnvdatetime(&sb, &fli->date, &fli->time); | cnvdatetime(&sb, &fli->date, &fli->time); |
| mileuc_ncpy(fli->path, de->d_name, sizeof(fli->path)); | mileuc_ncpy(fli->path, de->d_name, sizeof(fli->path)); |
| VERBOSE(("file_listnext: success\n")); | |
| return SUCCESS; | return SUCCESS; |
| } | } |