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

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: Use snprintf. 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.dart
diff --git a/runtime/bin/directory.dart b/runtime/bin/directory.dart
index a99de599780586b247cd411dc007b0bf68f39933..dcae9e55783a42c059e9b7a24caae0362dd08226 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,15 @@ 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 created.
Mads Ager (google) 2011/11/21 16:29:37 Maybe shorten this to just state that it is called
Bill Hesse 2011/11/22 12:49:39 Done.
+ * The handler is called when the directory creation is completed.
+ * The error handler is called if the directory creation fails.
+ */
+ 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));

Powered by Google App Engine
This is Rietveld 408576698