| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/platform_file.h" | 5 #include <stddef.h> |
| 6 #include <sys/_structs.h> |
| 7 #include <sys/errno.h> |
| 8 #include <sys/fcntl.h> |
| 9 #include <sys/stat.h> |
| 10 #include <sys/time.h> |
| 11 #include <unistd.h> |
| 12 #include <string> |
| 6 | 13 |
| 7 #include <fcntl.h> | 14 #include "base/basictypes.h" |
| 8 #include <errno.h> | |
| 9 #include <sys/stat.h> | |
| 10 | |
| 11 #include "base/eintr_wrapper.h" | 15 #include "base/eintr_wrapper.h" |
| 12 #include "base/file_path.h" | 16 #include "base/file_path.h" |
| 13 #include "base/logging.h" | 17 #include "base/logging.h" |
| 14 #include "base/utf_string_conversions.h" | 18 #include "base/platform_file.h" |
| 19 #include "base/time.h" |
| 20 #include "build/build_config.h" |
| 15 | 21 |
| 16 namespace base { | 22 namespace base { |
| 17 | 23 |
| 18 #if defined(OS_OPENBSD) || defined(OS_FREEBSD) || \ | 24 #if defined(OS_OPENBSD) || defined(OS_FREEBSD) || \ |
| 19 (defined(OS_MACOSX) && \ | 25 (defined(OS_MACOSX) && \ |
| 20 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) | 26 MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) |
| 21 typedef struct stat stat_wrapper_t; | 27 typedef struct stat stat_wrapper_t; |
| 22 static int CallFstat(int fd, stat_wrapper_t *sb) { | 28 static int CallFstat(int fd, stat_wrapper_t *sb) { |
| 23 return fstat(fd, sb); | 29 return fstat(fd, sb); |
| 24 } | 30 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 info->is_directory = S_ISDIR(file_info.st_mode); | 195 info->is_directory = S_ISDIR(file_info.st_mode); |
| 190 info->is_symbolic_link = S_ISLNK(file_info.st_mode); | 196 info->is_symbolic_link = S_ISLNK(file_info.st_mode); |
| 191 info->size = file_info.st_size; | 197 info->size = file_info.st_size; |
| 192 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); | 198 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); |
| 193 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); | 199 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); |
| 194 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); | 200 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); |
| 195 return true; | 201 return true; |
| 196 } | 202 } |
| 197 | 203 |
| 198 } // namespace base | 204 } // namespace base |
| OLD | NEW |