Index: sdk/lib/io/file.dart |
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart |
index dba693195e89c292f2c1b8bdc349c6ec3fe713fe..34bdb76bbd9f2f61e832a28c3062f4b2dbaf483d 100644 |
--- a/sdk/lib/io/file.dart |
+++ b/sdk/lib/io/file.dart |
@@ -270,8 +270,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. |
@@ -282,9 +287,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 the returning. |
+ * |
* Throws a [FileException] 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. |
@@ -296,10 +306,14 @@ 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: Encoding.UTF_8}); |
+ Encoding encoding: Encoding.UTF_8, |
+ bool flush: false}); |
/** |
* Synchronously write a string to a file. |
@@ -312,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 the returning. |
+ * |
* Throws a [FileException] if the operation fails. |
*/ |
void writeAsStringSync(String contents, |
{FileMode mode: FileMode.WRITE, |
- Encoding encoding: Encoding.UTF_8}); |
+ Encoding encoding: Encoding.UTF_8, |
+ bool flush: false}); |
/** |
* Get the path of the file. |