file

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: GPL-3.0 Imports: 17 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arr2str added in v0.0.18

func Arr2str(contents []string) (result string)

func Create

func Create(filename string, data []byte) error

Create 创建文件写入内容

func CreateDir

func CreateDir(filename string) error

CreateDir 创建文件夹

func CreateRequestBody added in v0.0.16

func CreateRequestBody(paramName, filename string) (string, io.Reader, error)

func Delete

func Delete(filename string) error

Delete 删除文件

func Exist

func Exist(filename string) bool

Exist 判断文件是否存在

func Md5

func Md5(filename string) (string, error)

Md5 读取文件的md5值

func Merge

func Merge(dir, filename string) error

Merge 合并临时文件

func Name

func Name(skip int) string

func ReadBytes

func ReadBytes(filename string) ([]byte, error)

ReadBytes 读取文件的内容

func Split

func Split(filename string, chunkSize int64, execute func(num int, data []byte)) error

Split 根据块大小切分文件

func Str2Arr added in v0.0.18

func Str2Arr(content string) (result []string)

func TrimSuffix added in v0.0.17

func TrimSuffix(filename string) string

TrimSuffix 去除文件名后缀

Types

type ListWithName

type ListWithName []fs.DirEntry

func (ListWithName) Len

func (l ListWithName) Len() int

func (ListWithName) Less

func (l ListWithName) Less(i, j int) bool

func (ListWithName) Swap

func (l ListWithName) Swap(i, j int)

type ListWithTime

type ListWithTime []fs.DirEntry

func (ListWithTime) Len

func (l ListWithTime) Len() int

func (ListWithTime) Less

func (l ListWithTime) Less(i, j int) bool

func (ListWithTime) Swap

func (l ListWithTime) Swap(i, j int)

Jump to

Keyboard shortcuts

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