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

Unified Diff: runtime/bin/directory_posix.cc

Issue 10414046: Add support for directory renaming to dart:io. (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/directory_posix.cc
diff --git a/runtime/bin/directory_posix.cc b/runtime/bin/directory_posix.cc
index 1c672a804d7e86ad6a6f0e51b2e20848f50a3a4c..7adb80f9156ab2d308131aee2181243b35b85a27 100644
--- a/runtime/bin/directory_posix.cc
+++ b/runtime/bin/directory_posix.cc
@@ -423,3 +423,10 @@ bool Directory::Delete(const char* dir_name, bool recursive) {
return DeleteRecursively(dir_name);
}
}
+
+
+bool Directory::Rename(const char* path, const char* new_path) {
+ ExistsResult exists = Exists(path);
+ if (exists != EXISTS) return false;
+ return (TEMP_FAILURE_RETRY(rename(path, new_path)) == 0);
+}

Powered by Google App Engine
This is Rietveld 408576698