Index: sdk/lib/_internal/pub/lib/src/io.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart |
index af8168e461b073ad4ee1c712d40dc5d3e598a894..d27fe133bc2094abfc89db053d6052df654d625f 100644 |
--- a/sdk/lib/_internal/pub/lib/src/io.dart |
+++ b/sdk/lib/_internal/pub/lib/src/io.dart |
@@ -228,23 +228,24 @@ String ensureDir(String dirPath) { |
return dirPath; |
} |
-/// Creates a temp directory whose name will be based on [dir] with a unique |
-/// suffix appended to it. If [dir] is not provided, a temp directory will be |
-/// created in a platform-dependent temporary location. Returns the path of the |
-/// created directory. |
+/// Creates a temp directory in [dir], whose name will be [prefix] with |
+/// characters appended to it to make a unique name. |
+/// Returns the path of the created directory. |
String createTempDir(String base, String prefix) { |
var tempDir = new Directory(base).createTempSync(prefix); |
log.io("Created temp directory ${tempDir.path}"); |
return tempDir.path; |
} |
+/// Creates a temp directory in the system temp directory, whose name will be |
+/// 'pub_' with characters appended to it to make a unique name. |
+/// Returns the path of the created directory. |
String createSystemTempDir() { |
- var tempDir = Directory.createSystemTempSync('pub_'); |
+ var tempDir = Directory.systemTemp.createTempSync('pub_'); |
log.io("Created temp directory ${tempDir.path}"); |
return tempDir.path; |
} |
- |
/// Lists the contents of [dir]. If [recursive] is `true`, lists subdirectory |
/// contents (defaults to `false`). If [includeHidden] is `true`, includes files |
/// and directories beginning with `.` (defaults to `false`). |