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

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: Indentation. 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/io/directory_impl.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »
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 86d6cd6542edd9ed1587d3e6c44ca267c9553a77..1c0e37142e8899b19ff2a8a1bcb70a2425a76044 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 default, the file is created only if
+ * all directories in the path exist. If [recursive] is true, all
+ * non-existing path components are created.
+ *
* 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 default, the file is created
+ * only if all directories in the path exist.
+ * If [recursive] is true, all non-existing path components are created.
+ *
* 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 | « sdk/lib/io/directory_impl.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698