stdos

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	*os.File
	// contains filtered or unexported fields
}

func (*File) Close

func (f *File) Close() error

Close closes the File, rendering it unusable for I/O.

func (*File) Info

func (f *File) Info() here.Info

Info returns the here.Info of the file

func (File) Name

func (f File) Name() string

Name retuns the name of the file in pkger format

func (*File) Open

func (f *File) Open(name string) (http.File, error)

Open implements the http.FileSystem interface. A FileSystem implements access to a collection of named files. The elements in a file path are separated by slash ('/', U+002F) characters, regardless of host operating system convention.

func (*File) Path

func (f *File) Path() here.Path

Path returns the here.Path of the file

func (*File) Readdir

func (f *File) Readdir(count int) ([]os.FileInfo, error)

Readdir reads the contents of the directory associated with file and returns a slice of up to n FileInfo values, as would be returned by Lstat, in directory order. Subsequent calls on the same file will yield further FileInfos.

If n > 0, Readdir returns at most n FileInfo structures. In this case, if Readdir returns an empty slice, it will return a non-nil error explaining why. At the end of a directory, the error is io.EOF.

If n <= 0, Readdir returns all the FileInfo from the directory in a single slice. In this case, if Readdir succeeds (reads all the way to the end of the directory), it returns the slice and a nil error. If it encounters an error before the end of the directory, Readdir returns the FileInfo read until that point and a non-nil error.

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

Stat returns the FileInfo structure describing file. If there is an error, it will be of type *PathError.

type Pkger

type Pkger struct {
	Here here.Info
	// contains filtered or unexported fields
}

func New

func New(her here.Info) (*Pkger, error)

New returns *Pkger for the provided here.Info

func (*Pkger) Create

func (fx *Pkger) Create(name string) (pkging.File, error)

Create creates the named file with mode 0666 (before umask) - It's actually 0644, truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR.

func (*Pkger) Current

func (f *Pkger) Current() (here.Info, error)

Current returns the here.Info representing the current Pkger implementation.

func (*Pkger) Info

func (f *Pkger) Info(p string) (here.Info, error)

Info returns the here.Info of the here.Path

func (*Pkger) MkdirAll

func (f *Pkger) MkdirAll(p string, perm os.FileMode) error

MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm (before umask) are used for all directories that MkdirAll creates. If path is already a directory, MkdirAll does nothing and returns nil.

func (*Pkger) Open

func (fx *Pkger) Open(name string) (pkging.File, error)

Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.

func (*Pkger) Parse

func (f *Pkger) Parse(p string) (here.Path, error)

Parse the string in here.Path format.

func (*Pkger) Remove

func (fx *Pkger) Remove(name string) error

Remove removes the named file or (empty) directory.

func (*Pkger) RemoveAll

func (fx *Pkger) RemoveAll(name string) error

RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error).

func (*Pkger) Stat

func (fx *Pkger) Stat(name string) (os.FileInfo, error)

Stat returns a FileInfo describing the named file.

func (*Pkger) Walk

func (f *Pkger) Walk(p string, wf filepath.WalkFunc) error

Walk walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by walkFn. The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient. Walk does not follow symbolic links. - That is from the standard library. I know. Their grammar teachers can not be happy with them right now.

Jump to

Keyboard shortcuts

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