Index: runtime/bin/directory.cc |
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc |
index 24e1326cbc8f847323686302274d89dec8b4989a..e8ceccd5a94db86d2a10deddd516c85a5919c8b9 100644 |
--- a/runtime/bin/directory.cc |
+++ b/runtime/bin/directory.cc |
@@ -76,6 +76,22 @@ void FUNCTION_NAME(Directory_Create)(Dart_NativeArguments args) { |
} |
+void FUNCTION_NAME(Directory_CreateTemp)(Dart_NativeArguments args) { |
+ Dart_EnterScope(); |
+ Dart_Handle path = Dart_GetNativeArgument(args, 1); |
+ Dart_Handle number = Dart_GetNativeArgument(args, 2); |
+ if (Dart_IsString(path) && Dart_IsInteger(number)) { |
+ char* result = Directory::CreateTemp(DartUtils::GetStringValue(path), |
+ DartUtils::GetIntegerValue(number)); |
+ Dart_SetReturnValue(args, Dart_NewString(result)); |
+ free(result); |
+ } else { |
+ Dart_SetReturnValue(args, Dart_NewString("")); |
+ } |
+ Dart_ExitScope(); |
+} |
+ |
+ |
void FUNCTION_NAME(Directory_Delete)(Dart_NativeArguments args) { |
Dart_EnterScope(); |
Dart_Handle path = Dart_GetNativeArgument(args, 1); |