openWrite abstract method

IOSink openWrite({FileMode mode: FileMode.WRITE, Encoding encoding: UTF8 })

Creates a new independent IOSink for the file. The IOSink must be closed when no longer used, to free system resources.

An IOSink for a file can be opened in two modes:

  • FileMode.WRITE: truncates the file to length zero.
  • FileMode.APPEND: sets the initial write position to the end of the file.

When writing strings through the returned IOSink the encoding specified using encoding will be used. The returned IOSink has an encoding property which can be changed after the IOSink has been created.

Source

IOSink openWrite({FileMode mode: FileMode.WRITE, Encoding encoding: UTF8});

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-io/File/openWrite.html