fsutil

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FsCWAFlags = os.O_CREATE | os.O_WRONLY | os.O_APPEND // create, append write-only
	FsCWTFlags = os.O_CREATE | os.O_WRONLY | os.O_TRUNC  // create, override write-only
	FsCWFlags  = os.O_CREATE | os.O_WRONLY               // create, write-only
	FsRFlags   = os.O_RDONLY                             // read-only
)

some commonly flag consts for open file

Variables

This section is empty.

Functions

func EmbedExtract

func EmbedExtract(fileSystem embed.FS, folder string) error

EmbedExtract is ...

func ExtName

func ExtName(fpath string) string

ExtName is ...

func IsDir

func IsDir(path string) bool

IsDir reports whether the named directory exists.

func IsFile

func IsFile(path string) bool

IsFile reports whether the named file or directory exists.

func MkDirs

func MkDirs(perm os.FileMode, dirPaths ...string) error

MkDirs batch make multi dirs at once

func MkSubDirs

func MkSubDirs(perm os.FileMode, parentDir string, subDirs ...string) error

MkSubDirs batch make multi sub-dirs at once

func OpenFile

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

OpenFile like os.OpenFile, but will auto create dir.

func Workdir

func Workdir() string

Workdir get

func WriteOSFile

func WriteOSFile(f *os.File, data any) (n int, err error)

WriteOSFile write data to give os.File, then close file. data type allow: string, []byte, io.Reader

Types

This section is empty.

Jump to

Keyboard shortcuts

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