好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

把数据流写到文件中

Use the File openWrite() method to create a new IOSink for a file, to write to the file a little at a time. To append to the file, set the mode argument to FileMode.APPEND (it defaults to FileMode.WRITE).

 import 'dart:io';

main() {
  var file = new File('file.txt');
  var sink = file.openWrite();
  sink.write('FILE ACCESSED ${new DateTime.now()}\n');

  // Close the IOSink to free system resources.
  sink.close();
} 

查看更多关于把数据流写到文件中的详细内容...

  阅读:67次