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

Unified Diff: runtime/bin/file_macos.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_macos.cc
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
index 7f0806130ea5221dba1a9b59544088ba22d6fb40..d508c2e1ffc8f725253b2b4ea015a2ca0810dad9 100644
--- a/runtime/bin/file_macos.cc
+++ b/runtime/bin/file_macos.cc
@@ -175,6 +175,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 (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) {
+ return st.st_mtime;
+ }
+ return -1;
+}
+
+
bool File::IsAbsolutePath(const char* pathname) {
return (pathname != NULL && pathname[0] == '/');
}

Powered by Google App Engine
This is Rietveld 408576698