comparison src/os/win32/ngx_files.c @ 2462:90d5ddfedbb1

use GetFileAttributesEx() instead of GetFileAttributes()
author Igor Sysoev <igor@sysoev.ru>
date Wed, 21 Jan 2009 15:56:29 +0000
parents f732b8509658
children ceef364208c8
comparison
equal deleted inserted replaced
2461:2d3026ea9a65 2462:90d5ddfedbb1
254 254
255 return rc; 255 return rc;
256 } 256 }
257 257
258 258
259 #if 0 259 ngx_int_t
260 260 ngx_file_info(u_char *file, ngx_file_info_t *sb)
261 ngx_int_t
262 ngx_file_info(char *file, ngx_file_info_t *sb)
263 { 261 {
264 WIN32_FILE_ATTRIBUTE_DATA fa; 262 WIN32_FILE_ATTRIBUTE_DATA fa;
265 263
266 /* NT4 and Win98 */ 264 /* NT4 and Win98 */
267 265
268 if (GetFileAttributesEx(file, GetFileExInfoStandard, &fa) == 0) { 266 if (GetFileAttributesEx((char *) file, GetFileExInfoStandard, &fa) == 0) {
269 return NGX_ERROR; 267 return NGX_ERROR;
270 } 268 }
271 269
272 sb->dwFileAttributes = fa.dwFileAttributes; 270 sb->dwFileAttributes = fa.dwFileAttributes;
273 sb->ftCreationTime = fa.ftCreationTime; 271 sb->ftCreationTime = fa.ftCreationTime;
277 sb->nFileSizeLow = fa.nFileSizeLow; 275 sb->nFileSizeLow = fa.nFileSizeLow;
278 276
279 return NGX_OK; 277 return NGX_OK;
280 } 278 }
281 279
282 #endif
283
284 280
285 ngx_int_t 281 ngx_int_t
286 ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s) 282 ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s)
287 { 283 {
288 uint64_t intervals; 284 uint64_t intervals;
298 if (SetFileTime(fd, NULL, NULL, &ft) != 0) { 294 if (SetFileTime(fd, NULL, NULL, &ft) != 0) {
299 return NGX_OK; 295 return NGX_OK;
300 } 296 }
301 297
302 return NGX_ERROR; 298 return NGX_ERROR;
303 }
304
305
306 ngx_int_t
307 ngx_file_info(u_char *file, ngx_file_info_t *sb)
308 {
309 /* Win95 */
310
311 sb->dwFileAttributes = GetFileAttributes((const char *) file);
312
313 if (sb->dwFileAttributes == INVALID_FILE_ATTRIBUTES) {
314 return NGX_ERROR;
315 }
316
317 return NGX_OK;
318 } 299 }
319 300
320 301
321 char * 302 char *
322 ngx_realpath(u_char *path, u_char *resolved) 303 ngx_realpath(u_char *path, u_char *resolved)