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

Unified Diff: runtime/bin/directory.cc

Issue 9316066: Implement recursive directory deletion. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 11 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.cc
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc
index 739c43aaaaef8b64b94667a4877f3ab076b0fbf3..534fc3c200b612cf4265b536435c8e94c5042102 100644
--- a/runtime/bin/directory.cc
+++ b/runtime/bin/directory.cc
@@ -121,8 +121,10 @@ void FUNCTION_NAME(Directory_CreateTemp)(Dart_NativeArguments args) {
void FUNCTION_NAME(Directory_Delete)(Dart_NativeArguments args) {
Dart_EnterScope();
Dart_Handle path = Dart_GetNativeArgument(args, 0);
- if (Dart_IsString(path)) {
- bool deleted = Directory::Delete(DartUtils::GetStringValue(path));
+ Dart_Handle recursive = Dart_GetNativeArgument(args, 1);
+ if (Dart_IsString(path) && Dart_IsBoolean(recursive)) {
+ bool deleted = Directory::Delete(DartUtils::GetStringValue(path),
+ DartUtils::GetBooleanValue(recursive));
Dart_SetReturnValue(args, Dart_NewBoolean(deleted));
} else {
Dart_SetReturnValue(args, Dart_NewBoolean(false));

Powered by Google App Engine
This is Rietveld 408576698