好得很程序员自学网

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

获取父目录

Use the FileSystemEntity parent property to get the parent of a file, directory, or symlink. This property is inherited by File, Directory, and Link.

 import 'dart:io';
import 'dart:async'; // Import not needed but added here to explicitly assign type for clarity below.

main() async {
  // List the contents of the system temp directory.
  Stream<FileSystemEntity> entityList =
      Directory.systemTemp.list(recursive: true, followLinks: false);

  await for (FileSystemEntity entity in entityList) print(entity.parent.path);
} 

查看更多关于获取父目录的详细内容...

  阅读:66次