io

package
v2.2.26 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Archive

func Archive(src []string, dst string) error

Archive 智能压缩文件

func Chmod

func Chmod(path string, permission os.FileMode) error

Chmod 修改文件/目录权限

func Chown

func Chown(path, user, group string) error

Chown 修改文件或目录所有者

func Cp

func Cp(src, dst string) error

Cp 复制文件或目录

func Empty

func Empty(path string) bool

Empty 判断路径是否为空

func Exists

func Exists(path string) bool

Exists 判断路径是否存在

func FileInfo

func FileInfo(path string) (os.FileInfo, error)

FileInfo 获取文件大小

func GetSymlink(path string) string

GetSymlink 获取软链接目标

func IsHidden

func IsHidden(path string) bool

IsHidden 判断是否为隐藏文件

func IsSymlink(mode os.FileMode) bool

IsSymlink 判读是否为软链接

func Mkdir

func Mkdir(path string, permission os.FileMode) error

Mkdir 创建目录

func Mv

func Mv(src, dst string) error

func Read

func Read(path string) (string, error)

Read 读取文件

func ReadDir

func ReadDir(path string) ([]os.DirEntry, error)

ReadDir 读取目录

func Remove

func Remove(path string) error

Remove 删除文件/目录

func Size

func Size(path string) (int64, error)

Size 获取路径大小

func TempDir

func TempDir(prefix string) (string, error)

TempDir 创建临时目录

func TempFile

func TempFile(prefix string) (*os.File, error)

TempFile 创建临时文件

func UnArchive

func UnArchive(file string, dst string) error

UnArchive 智能解压文件

func Write

func Write(path string, data string, permission os.FileMode) error

Write 写入文件

func WriteAppend

func WriteAppend(path string, data string) error

WriteAppend 追加写入文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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