Reading and Writing Files
Load and save text and bytes.
Why dart:io
To touch real files from a command-line program, you import dart:io. It gives Dart the power to read and write your disk.
import 'dart:io';Meet the File Class
A File object points at a path on disk. Creating one does not open or read anything yet, it just names the target.
final file = File('notes.txt');All lessons in this course
- Reading and Writing Files
- Directories, Paths, and FileSystemEntity
- Streaming Large Files
- Stdin, Stdout, and Process Args