Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: runtime/bin/file_win.cc

Issue 252123005: Make FileStat have millisecond precisions, for linux, mac and android. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | sdk/lib/io/file_system_entity.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_win.cc
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index f4be3498f6f281ca685d6cca6072b10f41658670..8dbfabd00a009ab4bced21592b27765a6fa5316c 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -461,6 +461,11 @@ char* File::LinkTarget(const char* pathname) {
}
+static int64_t TimespecToMilliseconds(const struct timespec& t) {
+ return t.tv_sec * 1000 + t.tv_nsec / 1000000;
+}
+
+
void File::Stat(const char* name, int64_t* data) {
File::Type type = GetType(name, false);
data[kType] = type;
@@ -470,9 +475,9 @@ void File::Stat(const char* name, int64_t* data) {
int stat_status = _wstat64(system_name, &st);
free(const_cast<wchar_t*>(system_name));
if (stat_status == 0) {
- data[kCreatedTime] = st.st_ctime;
- data[kModifiedTime] = st.st_mtime;
- data[kAccessedTime] = st.st_atime;
+ data[kCreatedTime] = st.st_ctime * 1000;
+ data[kModifiedTime] = st.st_mtime * 1000;
+ data[kAccessedTime] = st.st_atime * 1000;
data[kMode] = st.st_mode;
data[kSize] = st.st_size;
} else {
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | sdk/lib/io/file_system_entity.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698