OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_util.h" | 5 #include "base/file_util.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <libgen.h> | 10 #include <libgen.h> |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 return false; | 668 return false; |
669 } else { | 669 } else { |
670 #endif // defined(OS_ANDROID) | 670 #endif // defined(OS_ANDROID) |
671 if (CallStat(file_path.value().c_str(), &file_info) != 0) | 671 if (CallStat(file_path.value().c_str(), &file_info) != 0) |
672 return false; | 672 return false; |
673 #if defined(OS_ANDROID) | 673 #if defined(OS_ANDROID) |
674 } | 674 } |
675 #endif // defined(OS_ANDROID) | 675 #endif // defined(OS_ANDROID) |
676 results->is_directory = S_ISDIR(file_info.st_mode); | 676 results->is_directory = S_ISDIR(file_info.st_mode); |
677 results->size = file_info.st_size; | 677 results->size = file_info.st_size; |
678 #if defined(OS_MACOSX) | 678 #if defined(OS_MACOSX) || (defined(OS_FREEBSD) && __FreeBSD_version < 900000) |
679 results->last_modified = Time::FromTimeSpec(file_info.st_mtimespec); | 679 results->last_modified = Time::FromTimeSpec(file_info.st_mtimespec); |
680 results->last_accessed = Time::FromTimeSpec(file_info.st_atimespec); | 680 results->last_accessed = Time::FromTimeSpec(file_info.st_atimespec); |
681 results->creation_time = Time::FromTimeSpec(file_info.st_ctimespec); | 681 results->creation_time = Time::FromTimeSpec(file_info.st_ctimespec); |
682 #elif defined(OS_ANDROID) | 682 #elif defined(OS_ANDROID) |
683 results->last_modified = Time::FromTimeT(file_info.st_mtime); | 683 results->last_modified = Time::FromTimeT(file_info.st_mtime); |
684 results->last_accessed = Time::FromTimeT(file_info.st_atime); | 684 results->last_accessed = Time::FromTimeT(file_info.st_atime); |
685 results->creation_time = Time::FromTimeT(file_info.st_ctime); | 685 results->creation_time = Time::FromTimeT(file_info.st_ctime); |
686 #else | 686 #else |
687 results->last_modified = Time::FromTimeSpec(file_info.st_mtim); | 687 results->last_modified = Time::FromTimeSpec(file_info.st_mtim); |
688 results->last_accessed = Time::FromTimeSpec(file_info.st_atim); | 688 results->last_accessed = Time::FromTimeSpec(file_info.st_atim); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 result = false; | 960 result = false; |
961 if (IGNORE_EINTR(close(outfile)) < 0) | 961 if (IGNORE_EINTR(close(outfile)) < 0) |
962 result = false; | 962 result = false; |
963 | 963 |
964 return result; | 964 return result; |
965 } | 965 } |
966 #endif // !defined(OS_MACOSX) | 966 #endif // !defined(OS_MACOSX) |
967 | 967 |
968 } // namespace internal | 968 } // namespace internal |
969 } // namespace base | 969 } // namespace base |
OLD | NEW |