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

Unified Diff: runtime/bin/directory.dart

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.cc ('k') | runtime/bin/directory_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory.dart
diff --git a/runtime/bin/directory.dart b/runtime/bin/directory.dart
index a99de599780586b247cd411dc007b0bf68f39933..b98fd45297c3124c0b144f93c00b03bca9ee5f30 100644
--- a/runtime/bin/directory.dart
+++ b/runtime/bin/directory.dart
@@ -22,6 +22,19 @@ interface Directory factory _Directory {
void createSync();
/**
+ * Creates a temporary directory with a name based on the current path.
+ * This name and path is used as a template, and additional characters are
+ * appended to it by the call to make a unique directory name. If the
+ * path is the empty string, a default system temp directory and name
+ * are used for the template.
+ * The path is modified to be the path of the new directory.
+ * After the new directory is created, and the path modified, the callback
+ * createTempHandler will be called. The error handler is called if
+ * the temporary directory cannot be created.
+ */
+ void createTemp();
+
+ /**
* Deletes the directory with this name. Throws an exception
* if the directory is not empty or if deletion failed.
*/
@@ -59,7 +72,14 @@ interface Directory factory _Directory {
void set doneHandler(void doneHandler(bool completed));
/**
- * Sets the handler that is called on error listing directories.
+ * Set the handler that is called when a temporary directory is
+ * successfully created.
+ */
+ void set createTempHandler(void doneHandler(bool completed));
+
+ /**
+ * Sets the handler that is called if there is an error while listing
+ * or creating directories.
*/
void set errorHandler(void errorHandler(String error));
« no previous file with comments | « runtime/bin/directory.cc ('k') | runtime/bin/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698