fsutil

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotExist error = errors.New("ulib.fsutil: no file/folder found")
	ErrMethods  error = errors.New("ulib.fsutil: don't use weird methods")
)

Functions

func BasePaths added in v1.5.0

func BasePaths(src string) string

func CleanPaths added in v1.5.0

func CleanPaths(src string) string

func CopyAll added in v1.5.0

func CopyAll(src, dst string) error

func DirPath added in v1.5.0

func DirPath(src string) string

func Ext added in v1.5.0

func Ext(src string) string

func GetRunPath added in v1.4.0

func GetRunPath() (r string)

func IsDir added in v0.0.11

func IsDir(path string) bool

func IsExist added in v1.5.0

func IsExist(path string) bool

func IsFile added in v0.0.11

func IsFile(path string) bool

func JoinPaths added in v1.5.0

func JoinPaths(v ...string) string

func Mkdir added in v1.5.0

func Mkdir(path string, mode ...fs.FileMode) error

func Open added in v1.7.0

func Open(v string) (*os.File, error)

func OpenFile added in v1.7.0

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

func OpenRead added in v1.7.0

func OpenRead(v string) ([]byte, error)

func ReadDir added in v1.5.0

func ReadDir(path string) (f []string)

func ReadDirAll added in v1.5.0

func ReadDirAll(path string) (f []string)

func ReadDirRaw added in v1.5.0

func ReadDirRaw(r string) ([]fs.DirEntry, error)

func Remove added in v1.6.0

func Remove(v string) error

func SplitPath added in v1.5.0

func SplitPath(src string) (string, string)

Types

type FS added in v1.2.0

type FS struct {
	Path  string
	Data  string
	TRUNC bool
}

func File added in v0.0.11

func File(src string) *FS

func (*FS) CopyTo added in v1.3.0

func (f *FS) CopyTo(dst string) error

func (*FS) SetTrunc added in v1.2.0

func (f *FS) SetTrunc() *FS

func (*FS) Write added in v1.2.0

func (f *FS) Write(d any) error

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

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