file

package
v0.0.0-...-1a82670 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStringToFile

func AppendStringToFile(content string, filePath string) error

AppendStringToFile append string to file

func Exist

func Exist(path string) (existed bool, isDir bool)

Exist reports whether the file or directory exists.

func Exists

func Exists(path string) (existed bool)

Exists reports whether the file or directory exists.

func GetDirList

func GetDirList(path string) ([]string, error)

GetDirList get directory list

func GetDirListWithFilter

func GetDirListWithFilter(path string, filter Filter) ([]string, error)

GetDirListWithFilter get directory list with filter

func GetFilepaths

func GetFilepaths(dir string) ([]string, error)

GetFilepaths get all filepaths in a directory tree

func Mode

func Mode(path string) os.FileMode

Mode get file mode

func RecreateDir

func RecreateDir(dir string) error

RecreateDir recreate dir

func WriteStringToFile

func WriteStringToFile(content, path string, mode os.FileMode) (err error)

WriteStringToFile write string to file

Types

type File

type File struct {
	Path    string
	Content string
}

File template file

func GetFiles

func GetFiles(dir string) ([]*File, error)

GetFiles get files

type Filter

type Filter func(os.FileInfo) bool

Filter file filter

Jump to

Keyboard shortcuts

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