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 = |