comparison src/core/ngx_file.h @ 3024:8101d9101ed8

allow cross device temporary files atomic copying: *) ngx_copy_file() *) delete ngx_ext_rename_file_t.log_rename_error and .rename_error fields
author Igor Sysoev <igor@sysoev.ru>
date Wed, 12 Aug 2009 12:05:33 +0000
parents 8fc7b94f647b
children f9d97311c652
comparison
equal deleted inserted replaced
3023:7d5501988fe3 3024:8101d9101ed8
71 typedef struct { 71 typedef struct {
72 ngx_uint_t access; 72 ngx_uint_t access;
73 ngx_uint_t path_access; 73 ngx_uint_t path_access;
74 time_t time; 74 time_t time;
75 ngx_fd_t fd; 75 ngx_fd_t fd;
76 ngx_err_t rename_error;
77 76
78 unsigned create_path:1; 77 unsigned create_path:1;
79 unsigned delete_file:1; 78 unsigned delete_file:1;
80 unsigned log_rename_error:1;
81 79
82 ngx_log_t *log; 80 ngx_log_t *log;
83 } ngx_ext_rename_file_t; 81 } ngx_ext_rename_file_t;
82
83
84 typedef struct {
85 off_t size;
86 size_t buf_size;
87
88 ngx_uint_t access;
89 time_t time;
90
91 ngx_log_t *log;
92 } ngx_copy_file_t;
84 93
85 94
86 typedef struct ngx_tree_ctx_s ngx_tree_ctx_t; 95 typedef struct ngx_tree_ctx_s ngx_tree_ctx_t;
87 96
88 typedef ngx_int_t (*ngx_tree_init_handler_pt) (void *ctx, void *prev); 97 typedef ngx_int_t (*ngx_tree_init_handler_pt) (void *ctx, void *prev);
115 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access); 124 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access);
116 ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot); 125 ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot);
117 ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user); 126 ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user);
118 ngx_int_t ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to, 127 ngx_int_t ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to,
119 ngx_ext_rename_file_t *ext); 128 ngx_ext_rename_file_t *ext);
129 ngx_int_t ngx_copy_file(u_char *from, u_char *to, ngx_copy_file_t *cf);
120 ngx_int_t ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree); 130 ngx_int_t ngx_walk_tree(ngx_tree_ctx_t *ctx, ngx_str_t *tree);
121 131
122 void ngx_init_temp_number(void); 132 void ngx_init_temp_number(void);
123 ngx_atomic_uint_t ngx_next_temp_number(ngx_uint_t collision); 133 ngx_atomic_uint_t ngx_next_temp_number(ngx_uint_t collision);
124 134