Skip to content
Axiom/Docs

fs

@1

Files inside the mod's own directory.

Its own, and that is the whole capability: a path that climbs out of it is refused here rather than resolved and then checked, because a check after a resolve is a check against whatever the resolve produced. Anything outside needs fs.any, which is a different capability and a grant that is never automatic.

3 callsSurface as of 2026-10-21

Calls

read
read(path: str) -> Result<Blob>
In C, from surface.h
int32_t axiom_fs_read(const char* path, uint32_t path_length, uint8_t* out, uint32_t out_length, uint32_t* out_used);
writeWRITES
write(path: str, contents: Blob) -> Result<>
In C, from surface.h
int32_t axiom_fs_write(const char* path, uint32_t path_length, const uint8_t* contents, uint32_t contents_length);
exists
exists(path: str) -> Result<bool>
In C, from surface.h
int32_t axiom_fs_exists(const char* path, uint32_t path_length, int32_t* out);

Errors

A call that returns Result crosses as a status: 0 is success, and the others are these errors, by their index in the capability.

OutsideOwnDirectoryNotFoundDenied