gotools/txtar/fs.go

// FS returns the file system form of an Archive.
// It returns an error if any of the file names in the archive
// are not valid file system names.
// The archive must not be modified while the FS is in use.
//
// If the file system detects that it has been modified, calls to the
// file system return an ErrModified error.
func FS(a *Archive) (fs.FS, error) {}

const readOnly

const readOnlyDir

var ErrModified

type filesystem

type node

var _

var _

// initFiles initializes fsys from fsys.ar.Files. Returns an error if there are any
// invalid file names or collisions between file or directories.
func initFiles(fsys *filesystem) error {}

// insert adds node n as an entry to its parent directory within the filesystem.
func insert(fsys *filesystem, n *node) error {}

// directory returns the directory node with the path dir and lazily-creates it
// if it does not exist.
func directory(fsys *filesystem, dir string) (*node, error) {}

// dataOf returns the data associated with the file t.
// May return ErrModified if fsys.ar has been modified.
func dataOf(fsys *filesystem, n *node) ([]byte, error) {}

func (fsys *filesystem) Open(name string) (fs.File, error) {}

func (fsys *filesystem) ReadFile(name string) ([]byte, error) {}

type fileinfo

var _

var _

func (i *fileinfo) Name() string               {}

func (i *fileinfo) Size() int64                {}

func (i *fileinfo) Mode() fs.FileMode          {}

func (i *fileinfo) Type() fs.FileMode          {}

func (i *fileinfo) ModTime() time.Time         {}

func (i *fileinfo) IsDir() bool                {}

func (i *fileinfo) Sys() any                   {}

func (i *fileinfo) Info() (fs.FileInfo, error) {}

type openFile

var _

func (f *openFile) Stat() (fs.FileInfo, error) {}

func (f *openFile) Close() error               {}

func (f *openFile) Read(b []byte) (int, error) {}

func (f *openFile) Seek(offset int64, whence int) (int64, error) {}

func (f *openFile) ReadAt(b []byte, offset int64) (int, error) {}

type openDir

var _

func (d *openDir) Stat() (fs.FileInfo, error) {}

func (d *openDir) Close() error               {}

func (d *openDir) Read(b []byte) (int, error) {}

func (d *openDir) ReadDir(count int) ([]fs.DirEntry, error) {}