io library
The project's files and the processes the editor starts, wherever the package is compiled.
The editor reads and saves a project through dart:io, which the web
does not have. The editor's libraries, and a module's that touch files,
import this library instead of dart:io:
- on Windows, macOS, Linux, Android and iOS it is
dart:io's own File, Directory, Platform, Process and their kin, unchanged; - on the web (JavaScript and WebAssembly) it is stand-ins with the same members: Platform says it is none of the desktops, and every file or process call throws an UnsupportedError.
The editor never starts on the web — it edits the files on disk under the project folder, so it needs a desktop — and so never calls a stand-in. They exist so that a game which imports the editor in its debug entry point still compiles for the web and wasm, where the game then runs on its own.
Classes
- Directory
- A reference to a directory (or folder) on the file system.
- File
- A reference to a file on the file system.
- FileMode
- The modes in which a File can be opened.
- FileStat
-
The result of calling the POSIX
stat()function on a file system object. - FileSystemEntity
- The common superclass of File, Directory, and Link.
- FileSystemEntityType
- The type of an entity on the file system, such as a file, directory, or link.
- FileSystemEvent
- Base event class emitted by FileSystemEntity.watch.
- IOSink
- A combined byte and text output.
- Platform
- Information about the environment in which the current program is running.
- Process
- The means to execute a program.
- ProcessResult
- The result of running a non-interactive process started with Process.run or Process.runSync.
- RandomAccessFile
- Random access to the data in a file.
Functions
Exceptions / Errors
- FileSystemException
- Exception thrown when a file operation fails.
- OSError
- An Exception holding information about an error from the operating system.