Documentation ¶
Overview ¶
memfs implements a simple fake memory FS for Wazero.
The actual implementation of the FS is from github.com/blang/vfs/memfs, this package is just wrapping that for Wazero.
It implements only very small number of functions, because only those were needed for my purposes (that is, running ghostscript with WASI), as ghostscript only calls these.
Feel free to make a PR if you need to implement some other functions.
Index ¶
- type MemFS
- func (m *MemFS) Mkdir(path string, perm fs.FileMode) sys.Errno
- func (m *MemFS) OpenFile(path string, flag sys.Oflag, perm fs.FileMode) (sys.File, sys.Errno)
- func (m *MemFS) ReadFile(path string) ([]byte, sys.Errno)
- func (m *MemFS) Stat(path string) (wasys.Stat_t, sys.Errno)
- func (m *MemFS) Unlink(path string) sys.Errno
- func (m *MemFS) WriteFile(path string, content []byte) sys.Errno
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemFS ¶
type MemFS struct { sys.UnimplementedFS // contains filtered or unexported fields }
MemFS is a memory-only wazero filesystem, implementing just some basic functions.
func (*MemFS) ReadFile ¶
ReadFile is a helper function that returns a content of a file. Errors have the same semantics as wazero errors
Click to show internal directories.
Click to hide internal directories.