os

package
v4.0.0-rc4+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OS

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

OS a filesystem base on the os filesystem

func New

func New(baseDir string) *OS

New returns a new OS filesystem

func (*OS) Base

func (fs *OS) Base() string

Base returns the base path of the filesytem

func (*OS) Create

func (fs *OS) Create(filename string) (fs.File, error)

Create creates a file and opens it with standard permissions and modes O_RDWR, O_CREATE and O_TRUNC.

func (*OS) Dir

func (fs *OS) Dir(path string) fs.Filesystem

Dir returns a new Filesystem from the same type of fs using as baseDir the given path

func (*OS) Join

func (fs *OS) Join(elem ...string) string

Join joins the specified elements using the filesystem separator.

func (*OS) Open

func (fs *OS) Open(filename string) (fs.File, error)

Open opens a file in read-only mode.

func (*OS) OpenFile

func (fs *OS) OpenFile(filename string, flag int, perm os.FileMode) (fs.File, error)

OpenFile is equivalent to standard os.OpenFile. If flag os.O_CREATE is set, all parent directories will be created.

func (*OS) ReadDir

func (ofs *OS) ReadDir(path string) ([]fs.FileInfo, error)

ReadDir returns the filesystem info for all the archives under the specified path.

func (*OS) Remove

func (fs *OS) Remove(filename string) error

func (*OS) Rename

func (fs *OS) Rename(from, to string) error

func (*OS) Stat

func (fs *OS) Stat(filename string) (fs.FileInfo, error)

Stat returns the FileInfo structure describing file.

func (*OS) TempFile

func (fs *OS) TempFile(dir, prefix string) (fs.File, error)

Jump to

Keyboard shortcuts

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