Skip to content

Add top-level 'host' library.#95

Open
floitsch wants to merge 1 commit intomainfrom
floitsch/main-lib
Open

Add top-level 'host' library.#95
floitsch wants to merge 1 commit intomainfrom
floitsch/main-lib

Conversation

@floitsch
Copy link
Copy Markdown
Member

@floitsch floitsch commented Apr 5, 2026

Adds src/host.toit, which is automatically imported with 'import host'. Re-exports the most common functions from .file, .directory, .pipe, and .os, and introduces a few higher-level conveniences:

  • 'FileInfo' class with named accessors, returned by 'stat'
  • 'read' / 'write' with --bytes, --json, --yaml flag overloads (JSON uses streaming encode/decode)
  • 'with-tmp-directory' helper that cleans up in a 'finally'
  • 'list-directory' (block and list variants, with --full-path flag)

Adds src/host.toit, which is automatically imported with 'import host'.
Re-exports the most common functions from .file, .directory, .pipe, and
.os, and introduces a few higher-level conveniences:
- 'FileInfo' class with named accessors, returned by 'stat'
- 'read' / 'write' with --bytes, --json, --yaml flag overloads
  (JSON uses streaming encode/decode)
- 'with-tmp-directory' helper that cleans up in a 'finally'
- 'list-directory' (block and list variants, with --full-path flag)
@floitsch floitsch requested a review from kasperl April 5, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant