chroot

package
v0.0.0-...-e1c53df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package chroot implements a chroot virtual file system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	// contains filtered or unexported fields
}

FS is a chroot file system that implements the FS interface in the Go standard library.

func New

func New(path string) (*FS, error)

New returns a new choot filesystem.

func (*FS) Glob

func (fs *FS) Glob(pattern string) ([]string, error)

Glob returns the names of all files matching pattern or nil if there is no matching file.

func (*FS) Open

func (fs *FS) Open(name string) (fs.File, error)

Open opens the named file.

func (*FS) ReadDir

func (fs *FS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir reads the named directory

func (*FS) ReadFile

func (fs *FS) ReadFile(name string) ([]byte, error)

ReadFile reads the named file from the file system fs and returns its contents.

func (*FS) Stat

func (fs *FS) Stat(name string) (fs.FileInfo, error)

Stat returns a FileInfo describing the named file from the file system.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL