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

Unified Diff: runtime/bin/file_linux.cc

Issue 8598011: Implement delete on File objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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_linux.cc
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
index b816cc7e7a53430afe91bb0d2c45480f19e4f3dc..4a01e1c3064698f1647cdfe6ed500c7080d6b699 100644
--- a/runtime/bin/file_linux.cc
+++ b/runtime/bin/file_linux.cc
@@ -129,6 +129,15 @@ bool File::Create(const char* name) {
}
+bool File::Delete(const char* name) {
+ int status = remove(name);
+ if (status == -1) {
+ return false;
+ }
+ return true;
+}
+
+
bool File::IsAbsolutePath(const char* pathname) {
return (pathname != NULL && pathname[0] == '/');
}

Powered by Google App Engine
This is Rietveld 408576698