Skip to content

LocalWorkspace ​

Category: Fs

Source: local_workspace.dart

Classes ​

LocalWorkspace ​

A [Workspace] backed by the host filesystem via dart:io.

Used for both the host and Docker runtimes — Docker bind-mounts the host cwd at [WorkspaceMapping.runtimeCwd] so the host filesystem is authoritative either way. For Docker, a path expressed in the runtime's vocabulary (e.g. /workspace/foo.dart) is translated back to the host path before touching dart:io. Paths that are not under the mapping pass through unchanged, preserving compatibility with tools and agents that hand us absolute host paths.

Constructor ​

dart
LocalWorkspace(this.mapping)

Properties ​

PropertyTypeDescription
mappingWorkspaceMapping

Methods ​

Future<String> readFileAsString(String path) ​
Future<List<int>> readFileAsBytes(String path) ​
Future<void> writeFileAsString(String path, String content) ​
Future<void> writeFileAsBytes(String path, List<int> bytes) ​
Future<bool> exists(String path) ​
Future<bool> isDirectory(String path) ​
Future<List<WorkspaceEntry>> list(String path) ​
Future<int> sizeOf(String path) ​

Released under the MIT License.