wfs

package module
v0.0.0-...-922713f Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Unlicense Imports: 7 Imported by: 2

README

WFS

Easy work with filesystems.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecDir

func ExecDir() string

ExecDir returns the directory of the excutable file.

func ExecName

func ExecName() string

ExecName returns the name of the excutable file.

func ExecPath

func ExecPath() string

ExecPath returns the path to the executable file.

func OSTempDir

func OSTempDir() string

OSTempDir returns the system temp directory.

func SplitPath

func SplitPath(path string) []string

SplitPath cleans and split path.

func WorkTempDir

func WorkTempDir(prefix string) string

WorkTempDir creates and returns the working temp directory.

Types

type File

type File interface {
	io.Reader
	io.ReaderAt
	io.Writer
	io.Seeker
	io.Closer
	Name() string
	Stat() (fs.FileInfo, error)
	Truncate(int64) error
}

File interface.

type Filesystem

type Filesystem interface {
	Open(name string) (File, error)
	OpenFile(name string, flag int, perm fs.FileMode) (File, error)
	ChangeDir(name string) Filesystem
	Create(name string) (File, error)
	Remove(name string) error
	RemoveAll(path string) error
	Rename(oldpath, newpath string) error
	Mkdir(name string, perm fs.FileMode) error
	MkdirAll(path string, perm fs.FileMode) error
	Stat(name string) (fs.FileInfo, error)
	ReadDir(path string) ([]fs.DirEntry, error)
}

Filesystem interface.

func ExecFS

func ExecFS() Filesystem

ExecFS returns executable filesystem.

func OSTempFS

func OSTempFS() Filesystem

OSTempFS returns the system temp directory as Filesystem.

func OpenOS

func OpenOS(dir string) Filesystem

OpenOS opens os file as Filesystem.

func TempFS

func TempFS() Filesystem

TempFS returns the temp filesystem for current executable.

Jump to

Keyboard shortcuts

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