kfile

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileInDisk

func CheckFileInDisk(filename, localPath string) bool

检查目录中是否有指定文件 param: filename 文件名 可以是绝对路径 param: localPath 本地文件夹 notice: 如果读取目录失败,那么将会认为目录中没有这个文件

func CopyFile

func CopyFile(src, des string) (written int64, err error)

func Exists

func Exists(path string) bool

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory ...

func GetCurrentPackage

func GetCurrentPackage() string

GetCurrentPackage ...

func GetDirectoryPathByDate

func GetDirectoryPathByDate() string
 按年月日生成路径
 notice: 这个只有阿里云上传的时候创建路径用 其他地方尽量不要使用
			最终类似:  2019/January/10

func GetFileName

func GetFileName(path string) string

从路径中获取文件名 param: filepath 文件路径或者文件名 notice: 如果不是路径 则认为是文件

func GetFileSize

func GetFileSize(filepath string) (int64, error)

获取文件大小 param: filepath 文件路径或者文件名

func GetSuffixAndFilename

func GetSuffixAndFilename(filepath string) (filename, suffix string)

从路径中读取文件名与后缀 param: filepath 文件路径或者文件名

func GetSystemDelimiter

func GetSystemDelimiter() (delimiter string)

获取系统分隔符 notice: 其他系统自行兼容吧

func GetSystemLineBreak

func GetSystemLineBreak() (lineBreak string)

获取系统换行符号 notice: 其他系统自行兼容吧

func MakeDirectory

func MakeDirectory(dirs ...string) error

MakeDirectory ...

func TransCodeSize

func TransCodeSize(size int64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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