fallbackfs

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package fallbackfs implements a meta filesystem that wraps a sequence of file systems. If opening a file on the first file system fails, it is tried on the next file systems of the filesystem. This can be useful when the first file system has access restrictions that can be circumvented this way. A live Windows file system can be backed with a raw disk file system for example, to enable extraction of locked files.

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 implements a read-only meta file system where failing method calls to higher level file systems are passed to other file systems.

func New

func New(filesystems ...fs.FS) *FS

New creates a new fallback FS.

func (*FS) Open

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

Open opens a file for reading.

func (*FS) Stat

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

Stat returns an fs.FileInfo object that describes a file.

type Item

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

func (*Item) Close

func (i *Item) Close() error

func (*Item) Read

func (i *Item) Read(bytes []byte) (int, error)

func (*Item) ReadDir

func (i *Item) ReadDir(n int) ([]fs.DirEntry, error)

func (*Item) Stat

func (i *Item) Stat() (fs.FileInfo, error)

Jump to

Keyboard shortcuts

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