os

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountDirFiles

func CountDirFiles(dirName string) int

func GetDirNameListInDir

func GetDirNameListInDir(dir string, opts FilterOptions) ([]string, error)

GetDirNameListInDir :Get all Dir Name or file name List In Dir

func IsAbs

func IsAbs(hostPath string) bool

func IsCommandExist added in v0.9.0

func IsCommandExist(cmdName string) bool

func IsDir

func IsDir(path string) bool

func IsFileExist

func IsFileExist(fileName string) bool

func RecursionCopy

func RecursionCopy(src, dst string) error

func SetRootfsBinToSystemEnv

func SetRootfsBinToSystemEnv(rootfs string) error

Types

type FileReader

type FileReader interface {
	ReadLines() ([]string, error)
	ReadAll() ([]byte, error)
}

func NewFileReader

func NewFileReader(fileName string) FileReader

type FileWriter

type FileWriter interface {
	WriteFile(content []byte) error
}

func NewAtomicWriter

func NewAtomicWriter(fileName string) FileWriter

func NewCommonWriter

func NewCommonWriter(fileName string) FileWriter

type FilterOptions

type FilterOptions struct {
	All, OnlyDir, OnlyFile, WithFullPath bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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