Changeset 745
- Timestamp:
- 1999-10-26T11:27:51+13:00 (25 years ago)
- Location:
- trunk/gsdl/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/fileutil.cpp
r726 r745 28 28 /* 29 29 $Log$ 30 Revision 1.10 1999/10/25 22:27:51 sjboddie 31 added read_dir function - doesn't support windows yet 32 30 33 Revision 1.9 1999/10/19 03:52:25 davidb 31 34 added some useful functions for collection building … … 154 157 return false; 155 158 } 159 160 // need to do a windows version of this some time ... 161 #if defined __WIN32__ 162 bool read_dir (const text_t &dirname, text_tarray &filelist) {} 163 164 #else 165 166 #include <dirent.h> 167 168 bool read_dir (const text_t &dirname, text_tarray &filelist) { 169 170 filelist.erase (filelist.begin(), filelist.end()); 171 172 char *tmp = dirname.getcstr(); 173 DIR *dirin = opendir (tmp); 174 delete tmp; 175 176 if (dirin == NULL) return false; 177 178 dirent *dirp; 179 180 text_t filename; 181 while ((dirp = readdir (dirin)) != NULL) { 182 filename = dirp->d_name; 183 if (filename == "." || filename == ".." || filename == "CVS") 184 continue; 185 filelist.push_back (filename); 186 } 187 closedir (dirin); 188 return true; 189 } 190 191 #endif -
trunk/gsdl/lib/fileutil.h
r726 r745 46 46 bool file_writable (const text_t &filename); 47 47 48 bool read_dir (const text_t &dirname, text_tarray &filelist); 48 49 49 50 #endif
Note:
See TracChangeset
for help on using the changeset viewer.