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

Unified Diff: sdk/lib/io/directory.dart

Issue 25279003: dart:io | Add Directory.CreateSystemTemp(template) and change Directory.CreateTemp(template). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add check of "TMP" environment variable if "TMPDIR" is missing. Created 7 years, 3 months 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 | « sdk/lib/_internal/lib/io_patch.dart ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/directory.dart
diff --git a/sdk/lib/io/directory.dart b/sdk/lib/io/directory.dart
index 671064cccc48554c9e38f40be249285242996e92..6aa18f84c7aa22fe318e0fc4a225dc4124f695dc 100644
--- a/sdk/lib/io/directory.dart
+++ b/sdk/lib/io/directory.dart
@@ -68,25 +68,59 @@ abstract class Directory implements FileSystemEntity {
void createSync({bool recursive: false});
/**
- * Creates a temporary directory with a name based on the current
- * path. The path is used as a template, and additional
- * characters are appended to it to make a unique temporary
- * directory name. If the path is the empty string, a default
- * system temp directory and name are used for the template.
+ * Creates a temporary directory in this directory. Additional random
+ * characters are appended to [template] to produce a unique directory
+ * name.
*
* Returns a [:Future<Directory>:] that completes with the newly
* created temporary directory.
+ *
+ * Deprecated behavior, to be removed Oct 18, 2013: If the path is the
+ * empty string, the directory is created in the default system temp
+ * directory. This capability has been moved to the static function
+ * [createSystemTemp].
+ */
+ Future<Directory> createTemp([String template]);
+
+ /**
+ * Synchronously creates a temporary directory in this directory.
+ * Additional random characters are appended to [template] to produce
+ * a unique directory name.
+ *
+ * Returns the newly created temporary directory.
+ *
+ * Deprecated behavior, to be removed Oct 18, 2013: If the path is the
+ * empty string, the directory is created in the default system temp
+ * directory. This capability has been moved to the static function
+ * [createSystemTemp].
*/
- Future<Directory> createTemp();
+ Directory createTempSync([String template]);
/**
- * Synchronously creates a temporary directory with a name based on the
- * current path. The path is used as a template, and additional
- * characters are appended to it to make a unique temporary directory name.
- * If the path is the empty string, a default system temp directory and name
- * are used for the template. Returns the newly created temporary directory.
+ * Creates a temporary directory in the system temp directory.
+ * The location of the system temp directory is platform-dependent,
+ * and may be set by an environment variable.
+ * Additional random characters are appended to [template] to produce
+ * a unique directory name.
+ *
+ * Returns a [:Future<Directory>:] that completes with the newly
+ * created temporary directory.
+ */
+ static Future<Directory> createSystemTemp([String template]) =>
+ _Directory.createSystemTemp(template);
+
+ /**
+ * Synchronously creates a temporary directory in the system temp directory.
+ * The location of the system temp directory is platform-dependent,
+ * and may be set by an environment variable.
+ * Additional random characters are appended to [template] to produce
+ * a unique directory name.
+ *
+ * Returns a [:Future<Directory>:] that completes with the newly
+ * created temporary directory.
*/
- Directory createTempSync();
+ static Directory createSystemTempSync([String template]) =>
+ _Directory.createSystemTempSync(template);
Future<String> resolveSymbolicLinks();
« no previous file with comments | « sdk/lib/_internal/lib/io_patch.dart ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698