cowfs

package
v0.0.0-...-6a41818 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

README

Taken from https://github.com/spf13/afero/tree/master/ on 2021-10-22, adapted to fix readlink.

Commit SHA: cb1d580bf497eb65dcfcbf4d9d7d9596f340eac0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCopyOnWriteFs

func NewCopyOnWriteFs(base afero.Fs, layer afero.Fs) afero.Fs

Types

type CopyOnWriteFs

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

The CopyOnWriteFs is a union filesystem: a read only base file system with a possibly writeable layer on top. Changes to the file system will only be made in the overlay: Changing an existing file in the base layer which is not present in the overlay will copy the file to the overlay ("changing" includes also calls to e.g. Chtimes(), Chmod() and Chown()).

Reading directories is currently only supported via Open(), not OpenFile().

func (*CopyOnWriteFs) Chmod

func (u *CopyOnWriteFs) Chmod(name string, mode os.FileMode) error

func (*CopyOnWriteFs) Chown

func (u *CopyOnWriteFs) Chown(name string, uid, gid int) error

func (*CopyOnWriteFs) Chtimes

func (u *CopyOnWriteFs) Chtimes(name string, atime, mtime time.Time) error

func (*CopyOnWriteFs) Create

func (u *CopyOnWriteFs) Create(name string) (afero.File, error)

func (*CopyOnWriteFs) LstatIfPossible

func (u *CopyOnWriteFs) LstatIfPossible(name string) (os.FileInfo, bool, error)

func (*CopyOnWriteFs) Mkdir

func (u *CopyOnWriteFs) Mkdir(name string, perm os.FileMode) error

func (*CopyOnWriteFs) MkdirAll

func (u *CopyOnWriteFs) MkdirAll(name string, perm os.FileMode) error

func (*CopyOnWriteFs) Name

func (u *CopyOnWriteFs) Name() string

func (*CopyOnWriteFs) Open

func (u *CopyOnWriteFs) Open(name string) (afero.File, error)

This function handles the 9 different possibilities caused by the union which are the intersection of the following...

layer: doesn't exist, exists as a file, and exists as a directory
base:  doesn't exist, exists as a file, and exists as a directory

func (*CopyOnWriteFs) OpenFile

func (u *CopyOnWriteFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

func (*CopyOnWriteFs) ReadlinkIfPossible

func (u *CopyOnWriteFs) ReadlinkIfPossible(name string) (string, error)

func (*CopyOnWriteFs) Remove

func (u *CopyOnWriteFs) Remove(name string) error

Removing files present only in the base layer is not permitted. If a file is present in the base layer and the overlay, only the overlay will be removed.

func (*CopyOnWriteFs) RemoveAll

func (u *CopyOnWriteFs) RemoveAll(name string) error

func (*CopyOnWriteFs) Rename

func (u *CopyOnWriteFs) Rename(oldname, newname string) error

Renaming files present only in the base layer is not permitted

func (*CopyOnWriteFs) Stat

func (u *CopyOnWriteFs) Stat(name string) (os.FileInfo, error)

func (*CopyOnWriteFs) SymlinkIfPossible

func (u *CopyOnWriteFs) SymlinkIfPossible(oldname, newname string) error

Jump to

Keyboard shortcuts

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