io

package
v0.0.0-...-d8a4e70 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chmod

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

Chmod 修改文件/目录权限

func Chown

func Chown(path, user, group string) error

Chown 修改文件或目录所有者

func Compress

func Compress(dir string, src []string, dst string) error

Compress 压缩文件

func CountX

func CountX(path string) (int64, error)

CountX 统计目录下文件数

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 IsDir

func IsDir(path string) bool

IsDir 判断是否为目录

func IsHidden

func IsHidden(path string) bool

IsHidden 判断是否为隐藏文件

func IsSymlink(mode os.FileMode) bool

IsSymlink 判读是否为软链接

func ListCompress

func ListCompress(src string) ([]string, error)

ListCompress 获取压缩包内文件列表

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 ReadBytes

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

ReadBytes 读取文件

func ReadDir

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

ReadDir 读取目录

func Remove

func Remove(path string) error

Remove 删除文件/目录

func Search(path, keyword string, sub bool) (map[string]os.FileInfo, error)

Search 查找文件/文件夹

func SearchX

func SearchX(path, keyword string, sub bool) (map[string]os.FileInfo, error)

SearchX 查找文件/文件夹(find命令)

func Size

func Size(path string) (int64, error)

Size 获取路径大小

func SizeX

func SizeX(path string) (int64, error)

SizeX 获取路径大小(du命令)

func TempDir

func TempDir(prefix string) (string, error)

TempDir 创建临时目录

func TempFile

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

TempFile 创建临时文件

func UnCompress

func UnCompress(src string, dst string) error

UnCompress 解压文件

func Write

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

Write 写入文件

func WriteAppend

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

WriteAppend 追加写入文件

Types

type FormatArchive

type FormatArchive string
const (
	Zip      FormatArchive = "zip"
	Bz2      FormatArchive = "bz2"
	Tar      FormatArchive = "tar"
	TGz      FormatArchive = "tgz"
	Xz       FormatArchive = "xz"
	SevenZip FormatArchive = "7z"
)

Jump to

Keyboard shortcuts

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