osfs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package os provides a billy filesystem for the OS.

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 is a filesystem based 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) (billy.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) billy.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) (billy.File, error)

Open opens a file in read-only mode.

func (*OS) OpenFile

func (fs *OS) OpenFile(filename string, flag int, perm os.FileMode) (billy.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) ([]billy.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

Remove deletes a file in disk.

func (*OS) Rename

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

Rename moves a file in disk from _from_ to _to_.

func (*OS) Stat

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

Stat returns the FileInfo structure describing file.

func (*OS) TempFile

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

TempFile creates a new temporal file.

Jump to

Keyboard shortcuts

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