| 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 "base/platform_file.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 | 10 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) { | 181 bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) { |
| 182 if (!info) | 182 if (!info) |
| 183 return false; | 183 return false; |
| 184 | 184 |
| 185 stat_wrapper_t file_info; | 185 stat_wrapper_t file_info; |
| 186 if (CallFstat(file, &file_info)) | 186 if (CallFstat(file, &file_info)) |
| 187 return false; | 187 return false; |
| 188 | 188 |
| 189 info->is_directory = S_ISDIR(file_info.st_mode); | 189 info->is_directory = S_ISDIR(file_info.st_mode); |
| 190 info->is_symbolic_link = S_ISLNK(file_info.st_mode); |
| 190 info->size = file_info.st_size; | 191 info->size = file_info.st_size; |
| 191 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); | 192 info->last_modified = base::Time::FromTimeT(file_info.st_mtime); |
| 192 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); | 193 info->last_accessed = base::Time::FromTimeT(file_info.st_atime); |
| 193 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); | 194 info->creation_time = base::Time::FromTimeT(file_info.st_ctime); |
| 194 return true; | 195 return true; |
| 195 } | 196 } |
| 196 | 197 |
| 197 } // namespace base | 198 } // namespace base |
| OLD | NEW |