Skip to content

P0-S2a: Stat-by-fd helper and accurate sizes #83

@mconcat

Description

@mconcat

P0-S2a: Stat-by-fd helper and accurate sizes

Background

stat currently returns only basic type info. To support file I/O and tests, file sizes must be accurate post-write/truncate using overlay-aware size calculation.

Goal

Provide a VFS helper to stat by descriptor and update bindings to return accurate file size and type.

Design

  • Add stat_by_fd(fd) -> (size, type) that checks overlay first, then backend.
  • Update get_type/stat to call helper and map to WASI types.
  • Ensure directory kinds remain correct and unaffected.

Constraints

  • Deterministic outcome across nodes.

Acceptance Criteria

  • File size reflects content length after writes/appends/truncates.
  • Unit tests cover size changes; existing FS operation tests remain green.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions