Index: sdk/lib/io/file.dart |
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart |
index 174ca415d396471da819e941955b94e213f16905..36bb73cdeece8330b96afe3b37bd8bd8ed079dcb 100644 |
--- a/sdk/lib/io/file.dart |
+++ b/sdk/lib/io/file.dart |
@@ -269,8 +269,13 @@ abstract class File implements FileSystemEntity { |
* By default [writeAsBytes] creates the file for writing and truncates the |
* file if it already exists. In order to append the bytes to an existing |
* file, pass [FileMode.APPEND] as the optional mode parameter. |
+ * |
+ * If the argument [flush] is set to `true`, the data written will be |
+ * flushed to the file system before the returned future completes. |
*/ |
- Future<File> writeAsBytes(List<int> bytes, {FileMode mode: FileMode.WRITE}); |
+ Future<File> writeAsBytes(List<int> bytes, |
+ {FileMode mode: FileMode.WRITE, |
+ bool flush: false}); |
/** |
* Synchronously write a list of bytes to a file. |
@@ -281,9 +286,14 @@ abstract class File implements FileSystemEntity { |
* the file if it already exists. In order to append the bytes to an existing |
* file, pass [FileMode.APPEND] as the optional mode parameter. |
* |
+ * If the [flush] argument is set to `true` data written will be |
+ * flushed to the file system before returning. |
+ * |
* Throws a [FileSystemException] if the operation fails. |
*/ |
- void writeAsBytesSync(List<int> bytes, {FileMode mode: FileMode.WRITE}); |
+ void writeAsBytesSync(List<int> bytes, |
+ {FileMode mode: FileMode.WRITE, |
+ bool flush: false}); |
/** |
* Write a string to a file. |
@@ -295,10 +305,15 @@ abstract class File implements FileSystemEntity { |
* By default [writeAsString] creates the file for writing and truncates the |
* file if it already exists. In order to append the bytes to an existing |
* file, pass [FileMode.APPEND] as the optional mode parameter. |
+ * |
+ * If the argument [flush] is set to `true`, the data written will be |
+ * flushed to the file system before the returned future completes. |
+ * |
*/ |
Future<File> writeAsString(String contents, |
{FileMode mode: FileMode.WRITE, |
- Encoding encoding: UTF8}); |
+ Encoding encoding: UTF8, |
+ bool flush: false}); |
/** |
* Synchronously write a string to a file. |
@@ -311,11 +326,15 @@ abstract class File implements FileSystemEntity { |
* to an existing file, pass [FileMode.APPEND] as the optional mode |
* parameter. |
* |
+ * If the [flush] argument is set to `true` data written will be |
+ * flushed to the file system before returning. |
+ * |
* Throws a [FileSystemException] if the operation fails. |
*/ |
void writeAsStringSync(String contents, |
{FileMode mode: FileMode.WRITE, |
- Encoding encoding: UTF8}); |
+ Encoding encoding: UTF8, |
+ bool flush: false}); |
/** |
* Get the path of the file. |