7

Dartのディレクトリ全体とすべてのファイルを再帰的に削除するにはどうすればよいですか?

例えば:

/path/to/project/foo.dart
/path/to/project/remove/all/of/these
4

1 に答える 1

14

思ったより簡単です。

私があなたを正しく理解していれば、それは次のようになります:

import 'dart:io';

main() {
  // Deletes the directory "remove" with all folders and files under it.
  new Directory('remove').delete(recursive: true);
}
于 2012-12-29T14:29:19.177 に答える