好得很程序员自学网

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

删除文件,目录或链接

Use the FilesSystemEntity delete() method to delete a file, directory, or symlink. This method is inherited by File, Directory, and Link.

 import 'dart:io';

main() async {
  // Create a temporary directory.
  var dir = await Directory.systemTemp.createTemp('my_temp_dir');

  // Confirm it exists.
  print(await dir.exists());

  // Delete the directory.
  await dir.delete();

  // Confirm it no longer exists.
  print(await dir.exists());
} 

查看更多关于删除文件,目录或链接的详细内容...

  阅读:64次