Skip to content

EmscriptenFS

Defined in: packages/runtime/src/wasm/types.ts:39

Emscripten’s in-memory filesystem API (MEMFS), exposed on module.FS.

wasmExec uses this to seed MEMFS with host files before main() and to sync modified files back to the host VFS after the program exits.

ErrnoError: (errno) => Error

Defined in: packages/runtime/src/wasm/types.ts:71

Constructor for Emscripten FS errno errors (thrown by FS operations).

number

Error

cwd(): string

Defined in: packages/runtime/src/wasm/types.ts:61

Current working directory inside MEMFS.

string


getStream(fd): EmscriptenStream | null

Defined in: packages/runtime/src/wasm/types.ts:69

Look up an open stream by fd number; returns null if not open.

number

EmscriptenStream | null


isDir(mode): boolean

Defined in: packages/runtime/src/wasm/types.ts:63

Returns true if mode has the directory bit set.

number

boolean


isLink(mode): boolean

Defined in: packages/runtime/src/wasm/types.ts:65

Returns true if mode has the symlink bit set.

number

boolean


lstat(path): EmscriptenFSStat

Defined in: packages/runtime/src/wasm/types.ts:53

Stat a path without following a terminal symlink.

string

EmscriptenFSStat


makedev(major, minor): number

Defined in: packages/runtime/src/wasm/types.ts:67

Pack (major, minor) into an Emscripten device number.

number

number

number


mkdir(path): void

Defined in: packages/runtime/src/wasm/types.ts:41

Create a directory at path. Throws ErrnoError if it already exists.

string

void


readdir(path): string[]

Defined in: packages/runtime/src/wasm/types.ts:49

List entries in a directory — includes . and ...

string

string[]


readFile(path, opts): Uint8Array

Defined in: packages/runtime/src/wasm/types.ts:45

Read a file as raw bytes.

string

"binary"

Uint8Array

readFile(path, opts?): string | Uint8Array<ArrayBufferLike>

Defined in: packages/runtime/src/wasm/types.ts:47

Read a file as a string (default) or bytes.

string

string

string | Uint8Array<ArrayBufferLike>


readlink(path): string

Defined in: packages/runtime/src/wasm/types.ts:59

Read the target of a symlink.

string

string


stat(path): EmscriptenFSStat

Defined in: packages/runtime/src/wasm/types.ts:51

Stat a path, following symlinks on the final component.

string

EmscriptenFSStat


symlink(target, path): void

Defined in: packages/runtime/src/wasm/types.ts:57

Create a symlink at path pointing to target.

string

string

void


unlink(path): void

Defined in: packages/runtime/src/wasm/types.ts:55

Remove a regular file.

string

void


writeFile(path, data): void

Defined in: packages/runtime/src/wasm/types.ts:43

Write a file at path, creating or overwriting as needed.

string

string | Uint8Array<ArrayBufferLike>

void