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

Unified Diff: runtime/bin/file_win.cc

Issue 10443008: Implement File.lastModified. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
Index: runtime/bin/file_win.cc
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index 1293dce802ec5f57ccdb8b1cc2ff713cfa9f70b5..c69ba53bceafe2b293bf79e647388a0acff60741 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -163,6 +163,15 @@ off_t File::LengthFromName(const char* name) {
}
+time_t File::LastModified(const char* name) {
Anders Johnsen 2012/05/24 12:05:42 intptr_t
+ struct stat st;
+ if (stat(name, &st) == 0) {
+ return st.st_mtime;
+ }
+ return -1;
+}
+
+
bool File::IsAbsolutePath(const char* pathname) {
// Should we consider network paths?
if (pathname == NULL) return false;

Powered by Google App Engine
This is Rietveld 408576698