comparison src/os/win32/ngx_files.c @ 681:7e24168b0853 release-0.4.0

nginx-0.4.0-RELEASE import *) Change in internal API: the HTTP modules initialization was moved from the init module phase to the HTTP postconfiguration phase. *) Change: now the request body is not read beforehand for the ngx_http_perl_module: it's required to start the reading using the $r->has_request_body method. *) Feature: the ngx_http_perl_module supports the DECLINED return code. *) Feature: the ngx_http_dav_module supports the incoming "Date" header line for the PUT method. *) Feature: the "ssi" directive is available inside the "if" block. *) Bugfix: a segmentation fault occurred if there was an "index" directive with variables and the first index name was without variables; the bug had appeared in 0.1.29.
author Igor Sysoev <igor@sysoev.ru>
date Wed, 30 Aug 2006 10:39:17 +0000
parents 4d9ea73a627a
children 532d15ddbe68
comparison
equal deleted inserted replaced
680:63a949f7ed4f 681:7e24168b0853
259 259
260 #endif 260 #endif
261 261
262 262
263 ngx_int_t 263 ngx_int_t
264 ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s)
265 {
266 uint64_t intervals;
267 FILETIME ft;
268
269 /* 116444736000000000 is commented in src/os/win32/ngx_time.c */
270
271 intervals = s * 10000000 + 116444736000000000;
272
273 ft.dwLowDateTime = (DWORD) intervals;
274 ft.dwHighDateTime = (DWORD) (intervals >> 32);
275
276 if (SetFileTime(fd, NULL, NULL, &ft) != 0) {
277 return NGX_OK;
278 }
279
280 return NGX_ERROR;
281 }
282
283
284 ngx_int_t
264 ngx_file_info(u_char *file, ngx_file_info_t *sb) 285 ngx_file_info(u_char *file, ngx_file_info_t *sb)
265 { 286 {
266 /* Win95 */ 287 /* Win95 */
267 288
268 sb->dwFileAttributes = GetFileAttributes((const char *) file); 289 sb->dwFileAttributes = GetFileAttributes((const char *) file);
299 if (dir->ready) { 320 if (dir->ready) {
300 dir->ready = 0; 321 dir->ready = 0;
301 return NGX_OK; 322 return NGX_OK;
302 } 323 }
303 324
304 if (FindNextFile(dir->dir, &dir->fd) == 0) { 325 if (FindNextFile(dir->dir, &dir->fd) != 0) {
305 return NGX_ERROR; 326 return NGX_OK;
306 } 327 }
307 328
308 return NGX_OK; 329 return NGX_ERROR;
309 } 330 }
310 331
311 332
312 ngx_int_t 333 ngx_int_t
313 ngx_de_info(u_char *name, ngx_dir_t *dir) 334 ngx_de_info(u_char *name, ngx_dir_t *dir)