import "github.com/egdaemon/eg/runtime/x/wasi/egfs"
func CloneFS(ctx context.Context, dstdir string, rootdir string, archive fs.FS) (err error)
func DirExists(path string) bool
DirExists returns true IFF a non-directory file exists at the provided path.
func DirExistsFn(path string) func(ctx context.Context) bool
DirExistsFn returns a function compatible with eg.WhenFn that checks if a directory exists at the provided path.
func DirNotExistsFn(path string) func(ctx context.Context) bool
DirNotExistsFn returns a function compatible with eg.WhenFn that checks that no directory exists at the provided path.
func FileExists(path string) bool
FileExists returns true IFF a non-directory file exists at the provided path.
func FileExistsFn(path string) func(ctx context.Context) bool
FileExistsFn returns a function compatible with eg.WhenFn that checks if a non-directory file exists at the provided path.
func FileNotExistsFn(path string) func(ctx context.Context) bool
FileNotExistsFn returns a function compatible with eg.WhenFn that checks that no non-directory file exists at the provided path.
func Find(tree fs.FS, pattern string) iter.Seq[string]
func FindFirst(tree fs.FS, pattern string) string
func Inspect(ctx context.Context, archive fs.FS) (err error)
print the list of files an directories contained within the FS.
func Install(dst string, src io.Reader, options ...InstallOption) eg.OpFn
Install writes the contents of src to dst, creating parent directories as needed and truncating any existing file. src is consumed by the first run of the operation.
func MkDirs(perm fs.FileMode, paths ...string) (err error)
func String(path string) (string, error)
String returns the contents of the file at the provided path.
func StringLazy(path string) func() (string, error)
StringLazy returns a function that reads the file at the provided path when called.
InstallOption modifies how Install writes the file.
type InstallOption func(*installoptions)
func Perm(perm fs.FileMode) InstallOption
Perm sets the permissions of the installed file, defaults to 0644.