Changeset 785
- Timestamp:
- 1999-11-21T14:09:30+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/fileutil.cpp
r745 r785 28 28 /* 29 29 $Log$ 30 Revision 1.11 1999/11/21 01:09:30 sjboddie 31 added readdir function for windows 32 30 33 Revision 1.10 1999/10/25 22:27:51 sjboddie 31 34 added read_dir function - doesn't support windows yet … … 160 163 // need to do a windows version of this some time ... 161 164 #if defined __WIN32__ 162 bool read_dir (const text_t &dirname, text_tarray &filelist) {} 165 166 #include <windows.h> 167 168 BOOL read_dir (const text_t &dirname, text_tarray &filelist) { 169 170 WIN32_FIND_DATA FileData; 171 HANDLE hSearch; 172 DWORD dwAttrs; 173 char *dirpath = dirname.getcstr(); 174 strcat (dirpath, "\\*"); 175 176 BOOL finished = false; 177 178 hSearch = FindFirstFile(dirpath, &FileData); 179 if (hSearch == INVALID_HANDLE_VALUE) return false; 180 181 text_t filename = FileData.cFileName; 182 if (filename != "." && filename != ".." && filename != "CVS") 183 filelist.push_back (filename); 184 185 while (FindNextFile(hSearch, &FileData)) { 186 filename = FileData.cFileName; 187 if (filename == "." || filename == ".." || filename == "CVS") 188 continue; 189 filelist.push_back (filename); 190 } 191 192 FindClose(hSearch); 193 194 return true; 195 } 163 196 164 197 #else
Note:
See TracChangeset
for help on using the changeset viewer.