Mercurial > hg > nginx-quic
comparison src/os/win32/ngx_files.c @ 185:d5f50cefc322
nginx-0.0.1-2003-11-14-19:52:04 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 14 Nov 2003 16:52:04 +0000 |
parents | 1bf718ce0dde |
children | c1f3a3c7c5db |
comparison
equal
deleted
inserted
replaced
184:1bf718ce0dde | 185:d5f50cefc322 |
---|---|
218 | 218 |
219 return rc; | 219 return rc; |
220 } | 220 } |
221 | 221 |
222 | 222 |
223 int ngx_file_type(char *file, ngx_file_info_t *sb) | |
224 { | |
225 WIN32_FILE_ATTRIBUTE_DATA fa; | |
226 | |
227 /* NT4 and Win98 */ | |
228 | |
229 if (GetFileAttributesEx(file, GetFileExInfoStandard, &fa) == 0) { | |
230 return NGX_ERROR; | |
231 } | |
232 | |
233 sb->dwFileAttributes = fa.dwFileAttributes; | |
234 sb->ftCreationTime = fa.ftCreationTime; | |
235 sb->ftLastAccessTime = fa.ftLastAccessTime; | |
236 sb->ftLastWriteTime = fa.ftLastWriteTime; | |
237 sb->nFileSizeHigh = fa.nFileSizeHigh; | |
238 sb->nFileSizeLow = fa.nFileSizeLow; | |
239 | |
240 return NGX_OK; | |
241 } | |
242 | |
243 | |
244 #if 0 | |
245 | |
246 /* Win95 */ | |
247 | |
248 int ngx_file_type(char *file, ngx_file_info_t *sb) | |
249 { | |
250 sb->dwFileAttributes = GetFileAttributes(file); | |
251 | |
252 if (sb->dwFileAttributes == INVALID_FILE_ATTRIBUTES) { | |
253 return NGX_ERROR; | |
254 } | |
255 | |
256 return NGX_OK; | |
257 } | |
258 | |
259 #endif | |
260 | |
261 | |
223 int ngx_file_append_mode(ngx_fd_t fd) | 262 int ngx_file_append_mode(ngx_fd_t fd) |
224 { | 263 { |
225 if (SetFilePointer(fd, 0, NULL, FILE_END) == INVALID_SET_FILE_POINTER) { | 264 if (SetFilePointer(fd, 0, NULL, FILE_END) == INVALID_SET_FILE_POINTER) { |
226 if (ngx_errno != NO_ERROR) { | 265 if (ngx_errno != NO_ERROR) { |
227 return NGX_ERROR; | 266 return NGX_ERROR; |