Mercurial > hg > xemacs-beta
comparison src/dired-msw.c @ 819:6504113e7c2d
[xemacs-hg @ 2002-04-25 18:03:23 by andyp]
sync up windows branch from 21.4
author | andyp |
---|---|
date | Thu, 25 Apr 2002 18:04:24 +0000 |
parents | a5954632b187 |
children | 6728e641994e |
comparison
equal
deleted
inserted
replaced
818:accc481aef34 | 819:6504113e7c2d |
---|---|
187 Win32_file_dynarr *files = Dynarr_new (Win32_file); | 187 Win32_file_dynarr *files = Dynarr_new (Win32_file); |
188 struct re_pattern_buffer *bufp = NULL; | 188 struct re_pattern_buffer *bufp = NULL; |
189 int findex; | 189 int findex; |
190 DECLARE_EISTRING (win32pattern); | 190 DECLARE_EISTRING (win32pattern); |
191 HANDLE fh; | 191 HANDLE fh; |
192 int errm; | |
192 | 193 |
193 while (1) | 194 while (1) |
194 { | 195 { |
195 if (!NILP (pattern)) | 196 if (!NILP (pattern)) |
196 { | 197 { |
219 * terms of time. Hence, we take the time to write complicated | 220 * terms of time. Hence, we take the time to write complicated |
220 * Win32-specific code, instead of simple Unix-style stuff. | 221 * Win32-specific code, instead of simple Unix-style stuff. |
221 */ | 222 */ |
222 findex = 0; | 223 findex = 0; |
223 fh = INVALID_HANDLE_VALUE; | 224 fh = INVALID_HANDLE_VALUE; |
225 errm = SetErrorMode (SEM_FAILCRITICALERRORS | |
226 | SEM_NOOPENFILEERRORBOX); | |
224 | 227 |
225 while (1) | 228 while (1) |
226 { | 229 { |
227 Bytecount len; | 230 Bytecount len; |
228 DECLARE_EISTRING (filename); | 231 DECLARE_EISTRING (filename); |
232 | 235 |
233 if (fh == INVALID_HANDLE_VALUE) | 236 if (fh == INVALID_HANDLE_VALUE) |
234 { | 237 { |
235 fh = qxeFindFirstFile (eiextdata (win32pattern), &finddat); | 238 fh = qxeFindFirstFile (eiextdata (win32pattern), &finddat); |
236 if (fh == INVALID_HANDLE_VALUE) | 239 if (fh == INVALID_HANDLE_VALUE) |
237 report_file_error ("Opening directory", dirfile); | 240 { |
241 SetErrorMode (errm); | |
242 report_file_error ("Opening directory", dirfile); | |
243 } | |
238 } | 244 } |
239 else | 245 else |
240 { | 246 { |
241 if (! qxeFindNextFile (fh, &finddat)) | 247 if (! qxeFindNextFile (fh, &finddat)) |
242 { | 248 { |
243 if (GetLastError () == ERROR_NO_MORE_FILES) | 249 if (GetLastError() == ERROR_NO_MORE_FILES) |
244 break; | 250 { |
245 FindClose (fh); | 251 break; |
252 } | |
253 FindClose(fh); | |
254 SetErrorMode (errm); | |
246 report_file_error ("Reading directory", dirfile); | 255 report_file_error ("Reading directory", dirfile); |
247 } | 256 } |
248 } | 257 } |
249 | 258 |
250 file.dwFileAttributes = finddat.dwFileAttributes; | 259 file.dwFileAttributes = finddat.dwFileAttributes; |
281 } | 290 } |
282 if (fh != INVALID_HANDLE_VALUE) | 291 if (fh != INVALID_HANDLE_VALUE) |
283 FindClose (fh); | 292 FindClose (fh); |
284 break; | 293 break; |
285 } | 294 } |
295 | |
296 SetErrorMode (errm); | |
286 return (files); | 297 return (files); |
287 } | 298 } |
288 | 299 |
289 static Lisp_Object | 300 static Lisp_Object |
290 mswindows_format_file (Win32_file *file, int display_size, int add_newline) | 301 mswindows_format_file (Win32_file *file, int display_size, int add_newline) |