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

Unified Diff: runtime/bin/file.cc

Issue 13654002: Change how File/Directory/Link .delete works. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index 5c54ed8579360eef0dc579d8ea9525e3c5aa0c1c..9abfa23137ebc18d86c7f8a084200acf1f8b4d10 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -488,6 +488,23 @@ void FUNCTION_NAME(File_Delete)(Dart_NativeArguments args) {
}
+void FUNCTION_NAME(File_DeleteLink)(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ const char* str =
+ DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
+ bool result = File::DeleteLink(str);
+ if (result) {
+ Dart_SetReturnValue(args, Dart_NewBoolean(result));
+ } else {
+ Dart_Handle err = DartUtils::NewDartOSError(
+ new OSError(-1, "Not a link", OSError::kSystem));
Søren Gjesse 2013/04/05 12:52:50 Is this only failing when this is not a link? Coul
Anders Johnsen 2013/04/08 06:50:49 You are right. Do you know how we can set this fro
+ if (Dart_IsError(err)) Dart_PropagateError(err);
+ Dart_SetReturnValue(args, err);
+ }
+ Dart_ExitScope();
+}
+
+
void FUNCTION_NAME(File_Directory)(Dart_NativeArguments args) {
Dart_EnterScope();
const char* str =

Powered by Google App Engine
This is Rietveld 408576698