Directories, Paths, and FileSystemEntity
Navigate and inspect the file system.
The Directory Class
Just as File names a file, the Directory class names a folder. You build one from a path string, ready to inspect or create.
final dir = Directory('logs');Create a Folder
Call create to make the folder. Add recursive: true and Dart builds every missing parent folder for you in one go.
await dir.create(recursive: true);All lessons in this course
- Reading and Writing Files
- Directories, Paths, and FileSystemEntity
- Streaming Large Files
- Stdin, Stdout, and Process Args