fileutils

package
v0.0.0-...-b947d54 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 15 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src string, dst string, args ...bool) error

func CopyFile

func CopyFile(src, dst string) error

func CopyFileExistsSkip

func CopyFileExistsSkip(src, dst string) error

func CreateDirIfNotExist

func CreateDirIfNotExist(path string) error

func CreateFilePath

func CreateFilePath(localPath, fileName string) (string, error)

func CreateZipFile

func CreateZipFile(source, target string) (err error)

func GetFileSize

func GetFileSize(file *os.File) (int64, error)

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool
func IsFileSymlink(file os.FileInfo) bool
func IsPathSymlink(path string) bool

func MimeType

func MimeType(path string) (mime string)

func PathExists

func PathExists(path string) bool

func Pwd

func Pwd() (string, error)

返回程序当前目录

func ReadLinesChan

func ReadLinesChan(filePath string) (<-chan string, error)

func ReadLinesSlice

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

func ReadPropertiesFile

func ReadPropertiesFile(fileName string) (map[string]string, error)

func ReaderMimeType

func ReaderMimeType(r io.Reader) (mime string)

func TempFileName

func TempFileName(prefix string) string

Rand Temp file name

func WriteLinesSlice

func WriteLinesSlice(lines []string, path string) error

Types

type SyncFile

type SyncFile struct {
	// contains filtered or unexported fields
}

func NewSyncFile

func NewSyncFile(f *os.File) *SyncFile

NewSynchronizedFile synchronizes writing to a writer

func (*SyncFile) Close

func (sf *SyncFile) Close() error

func (*SyncFile) Write

func (sf *SyncFile) Write(b []byte) (int, error)

func (*SyncFile) WriteString

func (sf *SyncFile) WriteString(s string) (int, error)

Jump to

Keyboard shortcuts

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