0PricingLogin
Dart Academy · Lesson

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

  1. Reading and Writing Files
  2. Directories, Paths, and FileSystemEntity
  3. Streaming Large Files
  4. Stdin, Stdout, and Process Args
← Back to Dart Academy