Index: runtime/bin/file_win.cc |
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc |
index 4341edcc3a1a1bad1f05a48d6235dc3093ffe617..31620032bfd19d98f3108aff276c04daeb0d25d5 100644 |
--- a/runtime/bin/file_win.cc |
+++ b/runtime/bin/file_win.cc |
@@ -391,6 +391,31 @@ char* File::LinkTarget(const char* pathname) { |
} |
+void File::Stat(const char* name, int64_t* data) { |
+ File::Type type = GetType(name, false); |
+ data[kType] = type; |
+ data[kCreatedTime] = 0; |
+ data[kModifiedTime] = 0; |
+ data[kAccessedTime] = 0; |
+ data[kMode] = 0; |
+ data[kSize] = 0; |
+ if (type != kDoesNotExist) { |
+ struct _stat64 st; |
+ const wchar_t* system_name = StringUtils::Utf8ToWide(name); |
+ int stat_status = _wstat64(system_name, &st); |
+ if (stat_status == 0) { |
+ data[kCreatedTime] = st.st_ctime; |
+ data[kModifiedTime] = st.st_mtime; |
+ data[kAccessedTime] = st.st_atime; |
+ data[kMode] = st.st_mode; |
+ data[kSize] = st.st_size; |
+ } else { |
+ data[kType] = File::kDoesNotExist; |
+ } |
+ } |
+} |
+ |
+ |
time_t File::LastModified(const char* name) { |
struct _stat st; |
const wchar_t* system_name = StringUtils::Utf8ToWide(name); |