fileUtils

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(dstName, srcName string) (written int64, err error)

func CopyFileByBuffer

func CopyFileByBuffer(src, dst string, bufferSize int64) error

func Exist

func Exist(filename string) bool

判断文件十分存在

func FindAllFileBySuffix

func FindAllFileBySuffix(basePath string, suffix string) []string

func GetBasePath

func GetBasePath(fullFilename string) string

GetBasePath 获取基础路径

func GetCurrentDirectory

func GetCurrentDirectory() string

*

  • @Author $
  • @Description //TODO $
  • @Date $ $
  • @Param $
  • @return $ *

func GetFileNameNotSuffix

func GetFileNameNotSuffix(fullFilename string) string

GetFileNameNotSuffix 获取文件名

func GetFileSuffix

func GetFileSuffix(filenameWithSuffix string) string

GetFileSuffix 获取文件后缀

func GetFilenameWithSuffix

func GetFilenameWithSuffix(fullFilename string) string

GetFilenameWithSuffix 获取文件名带后缀 fullFilename 完整文件名称带路径,/var/data/test.txt 返回值 test.txt

func GetFullNameNotSuffix

func GetFullNameNotSuffix(fullFilename string) string

GetFullNameNotSuffix 获取不带后缀的完整文件名称

func GetListFiles

func GetListFiles(path string) []string

func Hash_file_sha1

func Hash_file_sha1(filePath string) (string, error)

func IsDir

func IsDir(path string) bool

IsDir 判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

IsFile 判断所给路径是否为文件

func ListFiles added in v0.0.3

func ListFiles(rootPath string, recursion bool, exts []string) ([]string, error)

ListFiles 大是大非

func ReplaceSuffix

func ReplaceSuffix(fullFilename string, newSuffix string) string

ReplaceSuffix 替换完整文件后缀

Types

This section is empty.

Jump to

Keyboard shortcuts

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