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

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

Issue 52363002: dart:io | Add 'recursive' flag to File.create and Link.create. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove recursive call to create(), simplifying control flow. 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 | « no previous file | sdk/lib/io/file_impl.dart » ('j') | sdk/lib/io/file_impl.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file.dart
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 174ca415d396471da819e941955b94e213f16905..a01f7a097cbae865b523aada1e02887675a3fb5c 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -44,20 +44,30 @@ abstract class File implements FileSystemEntity {
* Create the file. Returns a [:Future<File>:] that completes with
* the file when it has been created.
*
+ * If [recursive] is false, the file is created only if all directories
+ * in the path exist. If [recursive] is true, all non-existing path
+ * components are created.
Anders Johnsen 2013/10/30 12:23:56 Default is `false`.
Bill Hesse 2013/10/30 15:07:37 Done.
+ *
* Existing files are left untouched by [create]. Calling [create] on an
* existing file might fail if there are restrictive permissions on
* the file.
+ *
+ * Completes the future with a [FileSystemException] if the operation fails.
*/
- Future<File> create();
+ Future<File> create({bool recursive: false});
/**
* Synchronously create the file. Existing files are left untouched
* by [createSync]. Calling [createSync] on an existing file might fail
* if there are restrictive permissions on the file.
*
+ * If [recursive] is false, the file is created only if all directories
+ * in the path exist. If [recursive] is true, all non-existing path
+ * components are created.
Anders Johnsen 2013/10/30 12:23:56 Ditto.
Bill Hesse 2013/10/30 15:07:37 Done.
+ *
* Throws a [FileSystemException] if the operation fails.
*/
- void createSync();
+ void createSync({bool recursive: false});
/**
* Renames this file. Returns a `Future<File>` that completes
« no previous file with comments | « no previous file | sdk/lib/io/file_impl.dart » ('j') | sdk/lib/io/file_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698