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

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: Avoid test failures if /tmp does not exist. 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
« no previous file with comments | « runtime/bin/directory.h ('k') | runtime/bin/directory.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « runtime/bin/directory.h ('k') | runtime/bin/directory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698