Skip to content

fs: fully rooted, WASI, rewrite iterator - #33

Merged
tspader merged 72 commits into
mainfrom
at
Oct 1, 2026
Merged

tspader merged 72 commits into
mainfrom
at

Conversation

@tspader

@tspader tspader commented Oct 1, 2026

Copy link
Copy Markdown
Owner

sp_sys_symlink now takes a kind parameter. Making a link to a directory and making a link to a file are fundamentally different operations at the OS level, and omitting this at the call site forced us to choose between sniffing or accepting broken behavior.

sp_sys_get_root_label returns the path of the Nth filesystem root on WASM, and nothing on native platforms.

Several functions which used to return a s64 length and signal errors via a negative sentinel now return sp_err_t

sp_sys_open_dir now accepts a flag, SP_SYS_OPEN_DIR_NO_FOLLOW, which closes the TOCTOU where a directory is swapped for a symlink mid-walk

We rewrote directory iteration to be layered:

  • OS level, filling and parsing buffers with entries
  • A basic iterator that hands you one at a time and asks the OS layer to refill when empty
  • A high level iterator that handles the semantics of traversing directories

Further unfucking of errors

Basic WASM filesystem support

Fixed \ on POSIX platforms; it's now a legal character in a path

Stopped swallowing errors in the sp_fs_atomic

@tspader
tspader merged commit 872b6f7 into main Oct 1, 2026
9 checks passed
@tspader
tspader deleted the at branch October 1, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant