Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何递归删除 Dart 中的整个目录以及所有文件?
例如:
/path/to/project/foo.dart /path/to/project/remove/all/of/these
这比听起来容易。
如果我理解正确,它会是这样的:
import 'dart:io'; main() { // Deletes the directory "remove" with all folders and files under it. new Directory('remove').delete(recursive: true); }