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

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 25720002: Add Directory.systemTemp getter to replace createSystemTemp(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't add an extra / to a directory ending in // Created 7 years, 2 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.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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`).
« no previous file with comments | « sdk/lib/_internal/lib/io_patch.dart ('k') | sdk/lib/io/directory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698