好得很程序员自学网

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

创建一个文件

Use the File create() method to create a file. To create intermediate directories, set the recursive argument to true (default is false).

 import 'dart:io';

main() async {
  // Get the system temp directory.
  var systemTempDir = Directory.systemTemp;
  // Creates dir/, dir/subdir/, and dir/subdir/file.txt in the system
  // temp directory.
  var file = await new File('${systemTempDir.path}/dir/subdir/file.txt')
      .create(recursive: true);
  print(file.path);
} 

查看更多关于创建一个文件的详细内容...

  阅读:60次