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

Unified Diff: runtime/bin/directory.cc

Issue 8588029: Add Directory.createTemp() to asynchronously create a temporary directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added Windows code. 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/directory.cc
diff --git a/runtime/bin/directory.cc b/runtime/bin/directory.cc
index 24e1326cbc8f847323686302274d89dec8b4989a..7f01cec3e15c5e03170f7099575ef13a46251763 100644
--- a/runtime/bin/directory.cc
+++ b/runtime/bin/directory.cc
@@ -76,6 +76,20 @@ 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);
+ if (Dart_IsString(path)) {
+ char* result = Directory::CreateTemp(DartUtils::GetStringValue(path));
+ 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);

Powered by Google App Engine
This is Rietveld 408576698